Submitted by TPSec (View additional reports submitted by other wardens)
The NoyaValueOracle.getValue is used to convert the price of an asset to baseToken, using token routing when necessary.
If there is no oracle for two tokens, a route needs to be set up between them. This route can then be used to get a value using NoyaValueOracle.getValue.
However, theres a mistake in the NoyaValueOracle.getValue function that makes it give the wrong price.
The NoyaValueOracle.getValue will return incorrect prices for tokens when the configured priceRoutes[asset][baseToken].length is more than 1.
To set a price path for a token pair, the maintainer should use NoyaValueOracle.updatePriceRoute.
For instance, for the SOL to UNI conversion. 1 SOL is roughly equal to 21 UNI, but theres no direct oracle. So, the maintainer sets a route SOL  BNB  ETH  UNI.
When _getValue tries to convert 100 SOL into UNI, it should first convert SOL  BNB, then BNB  ETH, and lastly ETH  UNI. But, what _getValue really does is to convert SOL  BNB, SOL  ETH, and SOL  UNI.
You can see this error in the _getValue function, where asset is used each time instead of quotingToken.
The first problem comes up if the SOL  BNB, SOL  ETH, and SOL  UNI oracles are not set up. This will cause a revert of _getValue.
Even if we configure these oracles, the calculated value will still be incorrect.
Consider this example - the _getValue is called with the following parameters:
This will convert 100 SOL to UNI, using BNB and ETH as the route.
The result is calculated using quotingToken = ETH, baseToken = UNI, and the initialValue = 1.25, which returns 526.
However, the expected result should be 2094.
Replace asset with quotingToken:
HadiEsna (NOYA) confirmed and commented:
