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.
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).
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"%
-
Deploy your API using the intructions above.
-
Add your API url to your
.env
file asUNISWAP_API
UNISWAP_API='<YourUrl>'
-
Run the tests with:
yarn test:integ
Quoters will need to abide by the following schemas in order to successfully quote UniswapX orders.
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),
}
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.