How to get USD+ price?
Closed this issue · 1 comments
ChrisChan888 commented
ZumZoom commented
You should scale by the difference in decimals and divide by 1e18. See example here. For your case it'll be like this:
oracleResponse * srcTokenDecimals / dstTokenDecimals / 1e18 =
1963509366702897051261009902073 * 1e6 / 1e18 / 1e18 =
1.9635
Which is also obviously incorrect result as the price should be $1 but not $2. We'll look into that.