This is an example of getting a quote using the Uniswap V3 guide and includes running against mainnet or a locally deployed chain.
The core functionality of this example can be found in quote.ts
.
This application is a read only quoting application that communicates with the Ethereum mainnet. To configure the input token/amount and output token, edit the configuration file. The code should need no further modification to function.
- Run
yarn install
to install the project dependencies - Run
yarn install:chain
to download and install Foundry
- Create an API key using any of the Ethereum API providers and grab the respective RPC URL, eg
https://mainnet.infura.io/v3/0ac57a06f2994538829c14745750d721
- Set that as the value of the
mainnet
rpc
value inside the config.
Run yarn start
and navigate to http://localhost:3000/