function decayAndGetPrice( uint256 id_, uint256 amount_, uint48 time_ ) internal
Intended behavior.
Adjust the SDA and the pricing of a specific market id.
Negative behavior.
It shouldn’t be callable whenever
It shouldn’t be able to update inactive/ inexistent markets
The market capacity shouldn’t overflow/ underflow from the
unchecked
scope.
Preconditions.
Assumes the market exists and is functional
Assumes adjustments can be made.
Postconditions.
The
totalDebt
should be updated (is updated twice)The
lastDecay
should be updatedThe
metadata[id_].lastDecay
should be updated
Inputs.
id - controllable; amount - controllable: affects the number of
payout
tokens;block.timestamp
- partially controlled
Examine all function calls the function makes.
There are no external function calls here.