Debt Decay Faster Than Expected
The debt decay at a rate faster than expected, causing market makers to sell bond tokens at a lower price than expected.\\nThe following definition of the debt decay reference time following any purchases at time `t` taken from the whitepaper. The second variable, which is the delay increment, is rounded up. Following is taken from Page 15 of the whitepaper - Definition 27\\n\\nHowever, the actual implementation in the codebase differs from the specification. At Line 514, the delay increment is rounded down instead.\\n```\\nFile: BondBaseSDA.sol\\n        // Set last decay timestamp based on size of purchase to linearize decay\\n        uint256 lastDecayIncrement = debtDecayInterval.mulDiv(payout_, lastTuneDebt);\\n        metadata[id_].lastDecay += uint48(lastDecayIncrement);\\n```\\n
When computing the `lastDecayIncrement`, the result should be rounded up.\\n```\\n// Set last decay timestamp based on size of purchase to linearize decay\\n// Remove the line below\\n uint256 lastDecayIncrement = debtDecayInterval.mulDiv(payout_, lastTuneDebt);\\n// Add the line below\\n uint256 lastDecayIncrement = debtDecayInterval.mulDivUp(payout_, lastTuneDebt);\\nmetadata[id_].lastDecay // Add the line below\\n= uint48(lastDecayIncrement);\\n```\\n
When the delay increment (TD) is rounded down, the debt decay reference time increment will be smaller than expected. The debt component will then decay at a faster rate. As a result, the market price will not be adjusted in an optimized manner, and the market price will fall faster than expected, causing market makers to sell bond tokens at a lower price than expected.\\nFollowing is taken from Page 8 of the whitepaper - Definition 8\\n
```\\nFile: BondBaseSDA.sol\\n        // Set last decay timestamp based on size of purchase to linearize decay\\n        uint256 lastDecayIncrement = debtDecayInterval.mulDiv(payout_, lastTuneDebt);\\n        metadata[id_].lastDecay += uint48(lastDecayIncrement);\\n```\\n