MCPcopy Index your code
hub / github.com/Uniswap/uniswapx-parameterization-api

github.com/Uniswap/uniswapx-parameterization-api @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
496 symbols 1,042 edges 112 files 4 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

uniswapx-parametrization-api

Unit Tests

UniswapX Parameterization API is a service to parameterize UniswapX orders. The service fetches quotes on-demand from external providers to get a sense of the current market price for a given trade.

Getting Started

follow api-template README to get your AWS CDK set up and bootstrapped.

To run dynamodb-related tests, you need to have Java Runtime installed (https://www.java.com/en/download/manual.jsp).

Delopyment

Dev Environment

To deploy to your own AWS account,

yarn && yarn build

then

cdk deploy

after successful deployment, you should see something like

 ✅  GoudaParameterizationStack

✨  Deployment time: 93.78s

Outputs:
GoudaParameterizationStack.GoudaParameterizationEndpoint57A27B25 = <your dev url>
GoudaParameterizationStack.Url = <your dev url>

The project currently has a GET hello-world Api Gateway<>Lambda integration set up:

❯ curl <url>/prod/quote/hello-world
"hello world"%

Integration Tests

  1. Deploy your API using the intructions above.

  2. Add your API url to your .env file as UNISWAP_API

UNISWAP_API='<YourUrl>'

  1. Run the tests with: yarn test:integ

Webhook Quoting Schema

Quoters will need to abide by the following schemas in order to successfully quote UniswapX orders.

Request

This data will be included in the body of the request and will be sent to the given quote endpoint.

{
   tokenInChainId: number,
   tokenOutChainId: number,
   requestId: string,
   quoteId: string,
   tokenIn: string,
   tokenOut: string,
   amount: string,
   swapper: string,
   type: string (EXACT_INPUT or EXACT_OUTPUT),
}

Response

This data will be expected in the body of the quote response.

Note: if a quoter elects to not quote a swap they should still send back a response but with a zero value in the amountIn/amountOut field, depending on the trade type.

{
  chainId: number,
  requestId: number,
  quoteId: string,
  tokenIn: string,
  amountIn: string,
  tokenOut: string,
  amountOut: string,
  filler: string,
}

The quoteId, requestId, tokenIn, chainId, tokenIn, and tokenOut fields should be mirrored from the request. The filler address should be the address of the fill contract.

Extension points exported contracts — how you extend this code

CircuitBreakerConfigurationProvider (Interface)
(no doc) [4 implementers]
lib/providers/circuit-breaker/index.ts
Quoter (Interface)
(no doc) [4 implementers]
lib/quoters/index.ts
FillerAddressRepository (Interface)
(no doc) [4 implementers]
lib/repositories/filler-address-repository.ts
QuoteResponseData (Interface)
(no doc) [1 implementers]
lib/entities/QuoteResponse.ts
ContainerInjected (Interface)
(no doc)
lib/handlers/hard-quote/injector.ts
MockContainerInjected (Interface)
(no doc)
test/handlers/base.test.ts
CronDashboardStackProps (Interface)
(no doc)
bin/stacks/cron-dashboard-stack.ts
OrderServiceProvider (Interface)
(no doc) [4 implementers]
lib/providers/order/index.ts

Core symbols most depended-on inside this repo

putMetric
called by 62
lib/entities/aws-metrics-logger.ts
toCleanJSON
called by 27
lib/entities/QuoteRequest.ts
metricContext
called by 26
lib/entities/aws-metrics-logger.ts
quote
called by 26
lib/quoters/index.ts
checkDefined
called by 24
lib/preconditions/preconditions.ts
getCosignerData
called by 18
lib/handlers/hard-quote/handler.ts
toResponseJSON
called by 18
lib/entities/QuoteResponse.ts
create
called by 17
lib/repositories/fades-repository.ts

Shape

Method 206
Function 142
Class 102
Interface 36
Enum 10

Languages

TypeScript100%

Modules by API surface

lib/entities/QuoteResponse.ts24 symbols
lib/repositories/filler-address-repository.ts23 symbols
lib/entities/HardQuoteRequest.ts22 symbols
lib/entities/QuoteRequest.ts21 symbols
lib/util/errors.ts18 symbols
bin/stacks/param-dashboard-stack.ts16 symbols
lib/handlers/hard-quote/handler.ts15 symbols
lib/handlers/blueprints/cw-log-firehose-processor.js14 symbols
lib/repositories/fades-repository.ts12 symbols
lib/repositories/base.ts12 symbols
lib/quoters/WebhookQuoter.ts11 symbols
bin/stacks/cron-dashboard-stack.ts11 symbols

For agents

$ claude mcp add uniswapx-parameterization-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact