Uniswap Routing API 此仓库包含了 Uniswap V3 协议的路由 API。它部署了一个使用 @uniswap/smart-ord 协议的 API,部署在 AWS 上。
Uniswap Routing API 此仓库包含了 Uniswap V3 协议的路由 API。它部署了一个使用 @uniswap/smart-ord 协议的 API,部署在 AWS 上。
This repository contains routing API for the Uniswap V3 protocol.
It deploys an API to AWS that uses @uniswap/smart-order-router to search for the most efficient way to swap token A for token B.
To develop on the Routing API you must have an AWS account where you can deploy your API for testing.
The best way to develop and test the API is to deploy your own instance to AWS.
…npm install && npm run buildcdk deploy RoutingAPIStackRoutingAPIStack.Url = https://...curl --request GET '/quote?tokenInAddress=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&tokenInChainId=1&tokenOutAddress=0x1f9840a85d5af5bf1d1762f925bdaddc4201f984&tokenOutChainId=1&amount=100&type=exactIn'curl --request GET '/quote?tokenInAddress=&simulateFromAddress=&...'{'gasUseEstimate':string, 'gasUseEstimateQuote':string, 'quoteGasAdjusted':string, and 'gasUseEstimateUSD':string}fields will be updated/calculated using tenderly gasLimit estimate. These fields are already present even without Tenderly simulation, however in that case they are simply heuristics. The Tenderly gas estimates will be more accurate.
{'gasUseEstimate':string, 'gasUseEstimateQuote':string, 'quoteGasAdjusted':string, and 'gasUseEstimateUSD':string}fields will still be included, however they will be heuristics rather then Tenderly estimates. These heuristic values are not reliable for sending transactions on chain.
Unit tests are invoked by running npm run test:unit in the root directory. A 'watch' mode is also supported by running npm run test:unit:watch.
Integration tests run against a local DynamoDB node deployed using dynamodb-local. Note that JDK 8 is a dependency of this package. Invoke the integration tests by running npm run test:integ in the root directory.
The end-to-end tests fetch quotes from your deployed API, then execute the swaps on a Hardhat mainnet fork.
First deploy your test API using the instructions above. Then update your .env file with the URL of the API, and the RPC URL of an archive node:
UNISWAP_ROUTING_API='...'
ARCHIVE_NODE_RPC='...'Run the tests with:
npm run test:e2e暂无开放 Issues,或尚未同步最近议题。