Cushion bond markets are opened at wall price rather than current price
The bond market was initialised at the wall price instead of the current price, contrary to the documentation. This could make the bond market less responsive to price movements, as it would need to decay to reach the current market price rather than instantly trading at it.
Submitted by 0x52
Incorrect initial bond market price.
Proof of Concept
uint256 initialPrice = range.wall.high.price.mulDiv(bondScale, oracleScale);
uint256 initialPrice = invWallPrice.mulDiv(bondScale, oracleScale);
In the above lines the initial prices are set to the wall price rather than the current price as indicated in documentation.
Recommended Mitigation Steps
Initial price should be updated to open bond market at current price rather than wall price.
Oighty (Olympus) disagreed with severity and commented:
This is more of a design decision than a bug. However, we did make this change in the code prior to the audit (it didn’t get reflected in the repo). @ind-igo not sure how you want to handle.
Going to award as Medium assuming no additional input from sponsor on the topic.
It does deviate from the spec so I guess that’s appropriate. The system actually would work as-is, but would be less responsive to price movements into the cushions since the bond market would have to decay (which requires waiting) to reach the current market price vs. instantly providing a buy/sell at the current price.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code used the wall price variable instead of the current price variable when initialising the bond market.
Impact
The bond market would be less responsive to price movements, as it would have to decay to reach the current market price rather than instantly providing a buy or sell at the current price.
What the attacker needed
None
The fix
The initial price should be updated to open the bond market at the current price rather than the wall price; the sponsor noted this change was made prior to the audit.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A bond market lets users buy or sell at a set price. The code set that starting price to a boundary value (the wall price) instead of the live market price. This means trades might not happen at the fair current price until the market slowly adjusts.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.