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

use better price feed #23

Open
elee1766 opened this issue Aug 11, 2020 · 3 comments
Open

use better price feed #23

elee1766 opened this issue Aug 11, 2020 · 3 comments

Comments

@elee1766
Copy link

elee1766 commented Aug 11, 2020

right now the price feed being used is the coingecko price.

coingecko price for MTA right now is just wrong. coingecko is printing 7.40 when the price is really closer to 7.00

image

image

I propose using something like the 1inch price for some sort of size (100 dollars? 1000 dollars?) if it exists, otherwise fall back to coingecko. 1inch is more reflective of what actual price and therefore roi is

@Huanzhang89
Copy link
Contributor

Does 1inch or uniswap provide an api to easily get this data?

@penandlim
Copy link
Member

There may be cases where uniswap offers better price but coingecko is just wayy easier to use in case of aggregating multiple sources. If there is 1inch API, I would def use that over coingecko.

@elee1766
Copy link
Author

there is 1inch api

https://api.1inch.exchange/v1.1/quote?fromTokenSymbol=COMP&toTokenSymbol=USDC&amount=1000000000000000000

here is an example for COMP -> USDC

comp is 18 decimals so for amount i put 1e18. RN the response im getting for toTokenAmount is 182240097. since USDC is 6 digits, we find the price of 1 COMP to USDC to be 182.24097. Of course I would recommend going the other way when calculating prices, and using a reasonable amount of USDC, say 1000 or 10000 USDC to calculate the price.

https://1inch.exchange/#/api

that's their documentation

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

3 participants