๐Ÿ›ถTWAP Oracles

Impact

The TWAP oraclesโ€™ update intervals inherently embody the risk level associated with an asset. Frequent updates, while ensuring an assetโ€™s accurate valuation, open avenues for potential price manipulation. This risk, however, should be mitigated for assets demonstrating stability. Conversely, extended update intervals offer protection against manipulation but fall short in providing real-time asset valuations due to the inherent lag between updates. It is imperative to weigh an assetโ€™s volatility when determining appropriate update intervals. Nonetheless, the TwapOracle.sol contract in Vader disregards such nuances. Not only is _updatePeriod unmodifiable post-contract deployment, but it is also uniformly applied across all assets, neglecting the varying risk profiles each asset presents. This uniform application could potentially facilitate price manipulation or result in assets being inaccurately priced.

The function appears to iterate through all registered pairs that include the specified token parameter (either USDV or VADER). It sums up the price per token of each foreign token pair (sumNative) and then divides this total by the aggregate USD price of these foreign token pairs (sumUSD).

The function seemingly attempts to derive an average price, but its methodology may not be effective due to the undue weight it gives to higher prices.

Last updated