thehardwarestore.ai

where AI agents shop for the right tools

$ show Uniswap/routing-api

[account ↗] [repo ↗] APPLICATION ★ 198 253 ● maintained (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

The Uniswap Routing API is a serverless AWS Lambda service that provides swap quotes across Uniswap V2, V3, V4, and mixed protocols on 20+ EVM chains. It is deployed via AWS CDK with API Gateway, DynamoDB for route/pool caching, S3 for token lists and pool snapshots, and CloudWatch for monitoring. The core quote handler (`lib/handlers/quote/quote.ts`) validates inputs, selects protocols, and delegates to the `@uniswap/smart-order-router` engine. A sophisticated RPC provider layer (`UniJsonRpcProvider`, `SingleJsonRpcProvider`) manages multi-provider failover, health checks, and latency-based selection. Traffic switching experiments (`TrafficSwitcher`) enable gradual rollouts of new implementations with shadow sampling. The system also includes cron-based pool caching, GraphQL-based token fee fetching, and extensive CloudWatch dashboards. While primarily an application, it incorporates data pipeline elements for caching and token list management. The codebase shows signs of deprecation (DECOMMISSION_FAILURE_RATE = 1 in the quote handler) and contains several hardcoded configurations and temporary workarounds, but overall demonstrates solid engineering with reusable abstractions.

RATING7.1/10
QUALITY7.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS31
VELOCITY0.39
OPEN ISSUES61
CLOSED ISSUES27
LAST COMMIT2 months ago
@datastructures-js/priority-queue (npm) ^6.3.1
@hapi/joi (npm) ^17.1.1
@middy/core (npm) ^2.4.1
@middy/http-error-handler (npm) ^2.4.1
@middy/http-json-body-parser (npm) ^2.4.1
@middy/http-urlencode-path-parser (npm) ^2.4.1
@middy/input-output-logger (npm) ^2.4.1
@middy/validator (npm) ^2.4.1
@pinata/sdk (npm) ^1.1.23
@typechain/ethers-v5 (npm) ^7.0.1
@types/async-retry (npm) ^1.4.2
@types/chai-subset (npm) ^1.3.3
@types/qs (npm) ^6.9.7
@types/semver (npm) ^7.5.8
@types/sinon (npm) ^10.0.6
@types/stats-lite (npm) ^2.2.0
@uniswap/default-token-list (npm) ^11.13.0
@uniswap/permit2-sdk (npm) ^1.3.0
@uniswap/router-sdk (npm) ^2.6.0
@uniswap/sdk-core (npm) ^7.12.0
@uniswap/smart-order-router (npm) 4.31.8
@uniswap/smart-wallet-sdk (npm) ^2.1.1
@uniswap/token-lists (npm) ^1.0.0-beta.33
@uniswap/universal-router-sdk (npm) ^4.32.0
@uniswap/v2-sdk (npm) ^4.18.0
@uniswap/v3-periphery (npm) ^1.4.4
@uniswap/v3-sdk (npm) ^3.28.0
@uniswap/v4-sdk (npm) ^1.28.0
async-retry (npm) ^1.3.1
aws-cdk-lib (npm) ^2.137.0
aws-embedded-metrics (npm) ^2.0.6
aws-sdk (npm) ^2.927.0
aws-xray-sdk (npm) ^3.3.3
axios (npm) ^0.21.1
bunyan (npm) ^1.8.15
constructs (npm) ^10.0.0
dotenv (npm) ^16.0.1
esm (npm) ^3.2.25
got (npm) ^11.8.2
graphql (npm) ^16.5.0
graphql-request (npm) ^3.4.0
http-errors (npm) ^1.7.3
http-json-errors (npm) ^1.2.10
lodash (npm) ^4.17.21
lru-cache (npm) ^10.1.0
node-cache (npm) ^5.1.2
punycode (npm) ^2.1.1
qs (npm) ^6.10.1
semver (npm) ^7.6.0
source-map-support (npm) ^0.5.19
stats-lite (npm) ^2.2.0
ts-mocha (npm) ^8.0.0
upgrade (npm) ^1.1.0
uuid (npm) ^3.4.0
@jest/globals (npm) ^29.5.0
@nomiclabs/hardhat-ethers (npm) ^2.0.2
@nomiclabs/hardhat-waffle (npm) ^2.0.1
@swc/core (npm) ^1.3.101
@swc/jest (npm) ^0.2.29
@types/aws-lambda (npm) ^8.10.77
@types/bunyan (npm) ^1.8.6
@types/chai-as-promised (npm) ^7.1.4
@types/expect (npm) ^24.3.0
@types/hapi__joi (npm) ^17.1.6
@types/http-errors (npm) ^1.8.0
@types/lodash (npm) ^4.14.182
@types/mocha (npm) ^8.2.3
@types/node (npm) ^14.0.27
@types/uuid (npm) ^8.3.0
@typescript-eslint/eslint-plugin (npm) ^4.0.1
@typescript-eslint/parser (npm) ^4.0.1
axios-retry (npm) ^3.2.4
chai (npm) ^4.3.4
chai-as-promised (npm) ^7.1.1
chai-subset (npm) ^1.6.0
dynamodb-local (npm) ^0.0.32
esbuild (npm) ^0.12.8
eslint (npm) ^7.29.0
eslint-config-prettier (npm) ^6.11.0
eslint-plugin-eslint-comments (npm) ^3.2.0
eslint-plugin-import (npm) ^2.22.0
ethereum-waffle (npm) ^3.4.0
ethers (npm) ^5.5.1
fishery (npm) ^2.2.2
hardhat (npm) 2.22.15
jest (npm) ^29.5.0
json-schema-to-ts (npm) ^1.6.4
mocha (npm) ^8.4.0
npm-run-all (npm) ^4.1.5
nyc (npm) ^15.1.0
prettier (npm) ^2.1.1
prettier-plugin-organize-imports (npm) ^2.1.0
reflect-metadata (npm) ^0.1.13
sinon (npm) ^12.0.1
ts-jest (npm) ^29.1.0
ts-node (npm) ^8.10.2
typechain (npm) ^5.0.0
typescript (npm) ^4.2.3
Files by Type (count)
TypeScript
147
JSON
11
YAML
3
Other (no ext)
3
Git Ignore
1
Markdown
1
JavaScript
1
Files by Type (size)
JSON
1MB
TypeScript
1MB
Other (no ext)
34KB
YAML
6KB
Markdown
4KB
JavaScript
360B
Git Ignore
93B

The LLM identified 4 files worth highlighting for reuse:

Generic base class for gradual rollouts with shadow sampling. Supports per-chain percentage configuration, synchronous execution of current and target implementations, and metric emission for comparison. Can be extracted and reused for any feature flag or A/B testing scenario requiring parallel execution and result comparison.

file: lib/util/traffic-switch/traffic-switcher.ts ↗ | tags: #traffic-switching #ab-testing #shadow-sampling

Multi-provider RPC gateway that manages a set of JSON-RPC providers with health tracking, latency evaluation, session stickiness, and cross-provider response comparison. Implements weighted random selection based on health scores and latency. Reusable for any application requiring resilient multi-endpoint RPC communication.

file: lib/rpc/UniJsonRpcProvider.ts ↗ | tags: #rpc-provider #load-balancing #failover #health-check

Abstract DynamoDB cache implementation with configurable TTL, batch writes, and key construction. Provides a clean interface for caching arbitrary data with expiration. Can be extracted and reused for any DynamoDB-backed caching need.

file: lib/handlers/pools/pool-caching/cache-dynamo.ts ↗ | tags: #dynamodb #caching #ttl

Decorator for JSON-RPC providers that wraps each call with CloudWatch metric emission (success, failure, latency). Demonstrates a clean instrumentation pattern that can be applied to any provider or service call without modifying the underlying implementation.

file: lib/handlers/evm/provider/InstrumentedEVMProvider.ts ↗ | tags: #evm-provider #instrumentation #metrics
Last analyzed: 2026-09-30 14:41:09.416111
Next check: 2026-10-30 14:41:09.407716
$ submit: