That sounds like a Uniswap function, if so you need to dig through their documentation or code to find how to obtain that value. You can't get it from the function to actually swap, unless you're ok with getting the value after the swap has happened.
Important to consider that, depending on what you are wanting this data for, there are severe risks involved, you could open yourself up to flash loan type attacks. IIRC Uniswap has a feature where you can obtain a weighted average price instead of the current live price, which is designed to mitigate these risks, might want to look into and consider it.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments