Skip to content
Business logic Audit finding Intermediate

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.

0x52 Follow

Originally disclosed on Code4rena

Submitted by 0x52

https://github.com/code-423n4/2022-08-olympus/blob/b5e139d732eb4c07102f149fb9426d356af617aa/src/policies/Operator.sol#L363-L469

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.

0xean (judge) commented:

Going to award as Medium assuming no additional input from sponsor on the topic.

Oighty (Olympus) commented:

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.


The original report as published on Code4rena, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by 0x52

View all

211 more disclosed reports, best first.

More from Olympus DAO contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.