DeFiPIE protocol uses UniswapPriceOracle to get time-weighted average prices from Uniswap v2 or other DEX (clones Uniswap v2).
Every time the user interacts with a pool, the protocol gets the current price from Uniswap and averages it with the previously stored price, thereby achieving the Time-weighted average price effect, which in turn protects the protocol from price manipulation through flash loans.
Update price by pToken
Updating the price of an asset by the pToken address.
function updateUnderlyingPrice(address pToken) public override returns (uint)