What is the best way to get the USD price of a token #2424
-
What is the best way to know the USD price of the token? Right now I feel I am overcomplicating things.
I was wondering. is there a better way to do this? :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
up :) |
Beta Was this translation helpful? Give feedback.
-
Hi @rafaelfaria, it seems that you are calculating the USD price of a token within a PancakeSwap-like pool. I think what you did is a suitable way to calculate it since you are getting the real execution price of the trade. However, keep in mind that the price obtained may be different from the "real" market price in a CEX, since the price of a pool could be easily manipulated if it has low liquidity. This video should give you more insights about it. P.S.: I think this type of question would be better suited (and more promptly answered) in Ethereum Stack Exchange since it is not related to ethers.js :) |
Beta Was this translation helpful? Give feedback.
Hi @rafaelfaria, it seems that you are calculating the USD price of a token within a PancakeSwap-like pool. I think what you did is a suitable way to calculate it since you are getting the real execution price of the trade. However, keep in mind that the price obtained may be different from the "real" market price in a CEX, since the price of a pool could be easily manipulated if it has low liquidity. This video should give you more insights about it.
P.S.: I think this type of question would be better suited (and more promptly answered) in Ethereum Stack Exchange since it is not related to ethers.js :)