DittoETH

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

DITTO matched rewards are extremely low and will not incentivize users as expected

Summary

An important incentive in this system is to encourage users to create short and bid orders which stay on the books by issuing them DITTO rewards. The issue is that the maximum amount of DITTO rewards earnable by users is so exceptionally low that realistically this incentive system is completely broken and no users will be incentivized by it.

Vulnerability Details

Consider the implementation for calculating how much DITTO rewards to mint a user, which is calculated in the claimDittoMatchedReward function of the YieldFacet contract:

uint256 protocolTime = LibOrders.getOffsetTime() / 1 days;
uint256 elapsedTime = protocolTime - Vault.dittoMatchedTime;
uint256 totalReward =
Vault.dittoMatchedReward + elapsedTime * 1 days * Vault.dittoMatchedRate;
// User's proportion of the total token reward
uint256 sharesTotal = Vault.dittoMatchedShares;
uint256 userReward = shares.mul(totalReward).div(sharesTotal);
// Only update dittoMatchedTime when totalReward increases
if (elapsedTime > 0) {
Vault.dittoMatchedTime = uint16(protocolTime); // @dev(safe-cast)
}

Effectively, to calculate the total amount of DITTO rewards to mint across all users who earned rewards, it does the following calculation: uint256 totalReward = Vault.dittoMatchedReward + elapsedTime * 1 days * Vault.dittoMatchedRate;. Vault.dittoMatchedReward simply caches the existing owed rewards, so we can ignore it for this discussion. Therefore, totalRewards is effectively equal to (elapsed time in seconds from approx. creation of the vault) * Vault.dittoMatchedRate.

In the OwnerFacet contract, we can see that Vault.dittoMatchedRate must be <= 100:

function _setDittoMatchedRate(uint256 vault, uint16 rewardRate) private {
require(rewardRate <= 100, "above 100");
s.vault[vault].dittoMatchedRate = rewardRate;
}

Let's assume there's only one user who has dittoMatchedShares for now (meaning they will receive all rewards) and that Vault.dittoMatchedRate = 100. This effectively means 1e2 DITTO is minted per second, and that user will receive all these rewards.

Consider the amount of time it takes to mint 1e18 DITTO (which is the precision of this token) = 1e18/1e2 seconds = 115740740741 days. This is the most optimistic amount of time to earn a single DITTO token, which unless DITTO is valued astronomically high, these rewards will not incentivize any users.

Impact

The incentive system to prompting limitBid and limitShort orders through the dittoMatchedShares is completely broken and no users will be incentivized.

Tools Used

Manual review

Recommendations

The dittoMatchedRate should be set as a significantly higher number.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year 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.