Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create price feed using Uniswap end-of-block midpoint price #2

Open
stefanmendoza opened this issue Aug 21, 2020 · 0 comments
Open
Milestone

Comments

@stefanmendoza
Copy link
Owner

We should be able to get a price feed of a token pair by leveraging the uniswap-sdk. By providing an ethers provider when fetching the token pair information we can hook into the Infura websocket and get price information block-by-block. Most likely the best way to handle this is to have a web3 (or ethers?) subscription to get new blocks and on receipt of a new block, leverage the helper methods from the SDK to get the mid-price.

Docs for pricing:
https://uniswap.org/docs/v2/javascript-SDK/pricing/

See section 2.2 of the Uniswap V2 whitepaper:
https://uniswap.org/whitepaper.pdf

@stefanmendoza stefanmendoza added this to the 1.0.0 milestone Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant