Mig Bach
Mig Bach

Reputation: 65

UniswapV3.slot0() costs too much gas

Have a simple method in my solidity contract with just one method were I am testing to get a UniswapV3Pool value for a token and just through testing the method on BinanceSmartChain-Testnet the method always returns:

response from method call

The method is just:

/// @notice
///   📝 calculates USD token price from main UniswapV3Pool
function calculatePriceInStableCoinV2
(
  address _adrUsdtPool
)
public view
returns
(
  uint160
)
{
  (uint160 sqrtPriceX96, , , , , , ) = IUniswapV3Pool(_adrUsdtPool).slot0();
  return sqrtPriceX96;
}

I don't know, but I have tried it many times and the method just fails to execute, is this an issue with the .slot0() method in the UniswapV3Pool contract ?

Upvotes: 0

Views: 54

Answers (1)

Mig Bach
Mig Bach

Reputation: 65

All working as expected after a delay in the BSC-Testnet.

Upvotes: 0

Related Questions