DittoETH

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

Business logic error

Summary

To work properly the protocol needs a healthy amount of bids, asks and short limit orders to facilitate price discovery and allow market participants to gauge market sentiment and identify potential trading opportunities together with enough collateral to incentivize shorters with matched orders to keep their positions. The problem lies in the fact that there are a couple of mechanisms that incentivize users not to keep limit bids or shorts on the order book.

Vulnerability Details

  1. In order for users to keep open bid and short limit orders they need to back them with collateral (1x for bids and 5x for shorts). This means that for every moment a user keeps their position open they are de facto losing anywhere between 4%-8% in terms of missed APY. The whole point of an order book is for users to place limit orders targeting prices different from the market price, depending on their wants and needs some place at a distance of +-1%, other at +-5%, 10% and so forth. Waiting a long time for a +-5% limit order to be matched is a really inefficient way of capital allocation given that the gains represented by the price appreciation/depreciation can be decreased/canceled by the opportunity cost.
  2. In case the aspects presented at point A will somehow not manifest, and the order book will be full of limit orders, increasing the yield for matched short orders, people will trade with themselves, matching short orders and increasing their collateral to the maximum CR (uint256 internal constant CRATIO_MAX = 15 ether;) in order to extract as much as possible from the protocol yield. Whales doing this will earn a bigger piece of the pie, eliminating the incentives for normal users to use the protocol as intended. Basically, in case the protocol gets really popular with normal users, that CRATIO_MAX will incentivize whales to use the protocol as a yield farm.

The ditto token rewards mechanism will not be enough to incentivize open limit orders and to disincentivize over collateralized shortRecords because it's a new governance token, that has no current utility or intrinsic value, at least at the start of the protocol.

Impact

Lack of a healthy number of open limit orders + shorts that represent the backbone of any orderbook based market.
People gaming the protocol and transforming it in a yield farm.

Tools Used

Manual review

Recommendations

  1. Make a system where open limit bids / shorts earn some yield for their collateral. Not 100%, maybe a linearly adjusting factor that decreases their yield based on the time an order remains open - for example the first 7 days an open order gets 80% of the yield for their collateral, after that 70% for the next 7 days and so on. These percentages and amount of days could be adjusted. The main idea is a mechanism that alleviates the opportunity cost is needed, especially at start.

  2. Make the CRATIO_MAX a variable parameter. If people decide to use the protocol in a way it was not intended the protocol owner could adjust it to values closer to the initial default CR (currently at 5 ether).

Updates

Lead Judging Commences

0xnevi Lead Judge
about 2 years ago
0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement

Support

FAQs

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