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

Pulling Uniswap MKR/ETH price via Multicall contract #57

Closed
wants to merge 1 commit into from

Conversation

ddaws
Copy link

@ddaws ddaws commented Mar 19, 2020

As per the title I am now pulling the MKR/ETH price from the Uniswap MKR exchange contract via Multicall. To do this I am getTokenToEthInputPrice which returns the amount of ETH that can be bought for a 1 token of MKR

For reference: https://docs.uniswap.io/smart-contract-api/exchange#getethtotokeninputprice

Here's are some screenshots!

Screen Shot 2020-03-19 at 12 13 58 PM

Screen Shot 2020-03-19 at 12 14 09 PM

Note: I believe I found a bug in ethers.js v5.0-beta and had to filter methods that are marked as not payable and not constant. I opted to filter the ABI at runtime because it is more explicit than modifying the ABI. I've left a comment in the code and opened a ticket with ethers.js

Closes #56

@ddaws ddaws closed this May 11, 2022
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

Successfully merging this pull request may close these issues.

Extra Metrics: Under SCD MKR price, show uniswap MKR/ETH price
1 participant