Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/advaita-saha/uniswappricesmulticall
A solution that leverages the concept of multicalls to efficiently retrieve multiple token prices from Uniswap, by reducing the number of calls to the blockchain node.
https://github.com/advaita-saha/uniswappricesmulticall
Last synced: 24 days ago
JSON representation
A solution that leverages the concept of multicalls to efficiently retrieve multiple token prices from Uniswap, by reducing the number of calls to the blockchain node.
- Host: GitHub
- URL: https://github.com/advaita-saha/uniswappricesmulticall
- Owner: advaita-saha
- License: mit
- Created: 2023-02-05T05:11:46.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-05T05:17:06.000Z (almost 2 years ago)
- Last Synced: 2024-10-22T22:55:57.834Z (2 months ago)
- Language: Solidity
- Size: 85.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multicall-Based Uniswap Price Retrieval Solution
A solution that leverages the concept of multicalls to efficiently retrieve multiple token prices from Uniswap, by reducing the number of calls to the blockchain node.
### Considerations
- An ethereum mainnet fork is setup in the `hardhat.config.js`
- The default base token for price retrieval is set to WETH
- The uniswapV3 price oracle is used to calculate ( time weighted average price )
- The `.env.example` is a sample file of the node url, make a `.env` with the example reference and put your node url ( preferebly alchemy/infura )
- `.nvmrc` file is set to node version `16.14.2`### Future Optimizations
- The oracle library function is used to calculate the `tick`. This also computes few other things which are not needed
- This can be removed and a custom function can be written to calculate the `tick` onlyTry running some of the following commands:
```shell
npm install
npx hardhat compile
npx hardhat test
```Create your own mainnet fork : `npx hardhat node --fork `