DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

Lack of Handling for Potential TWAP Issues in Circuit Breaker Mechanism

Summary

Lack of Handling for Potential TWAP Issues in Circuit Breaker Mechanism

Vulnerability Details

The baseOracleCircuitBreaker function uses the Time-Weighted Average Price (TWAP) as a fallback when there are issues with the Chainlink oracle data. However, it doesn't handle potential issues with the TWAP itself. If the TWAP is manipulated or incorrect due to issues in the underlying Uniswap pool, it could lead to incorrect pricing information.

Impact

It could potentially impact the contract's functionality and accuracy of data

Tools Used

Manual

Recommendations

To resolve this issue, consider implementing additional checks and fallback mechanisms to handle potential anomalies in the TWAP.

  1. Implement a sanity check for the TWAP price: This could involve comparing the TWAP price against a range of acceptable values. If the TWAP price falls outside this range, the function could revert or fall back to another pricing mechanism.

  2. Use multiple sources for TWAP: Instead of relying solely on Uniswap, consider fetching TWAP from multiple decentralized exchanges (DEXs) and use the median or average value. This can help mitigate the risk of manipulation or anomalies in a single DEX.

  3. Implement a fallback mechanism: In case both Chainlink and TWAP prices are found to be invalid or manipulated, consider having a fallback mechanism. This could be a trusted external oracle or a governance vote to manually set the price.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.