In the docs it is said that shorts and bids with a price difference greater than 1% from oracle price should revert, however this is not the case.
"price is within 1% of the actual oracle price at that moment. If it's below the oracle price, or over 1% of the oracle price, the transaction will fail."
This mechanism is intended to ensure that the asset maintains its peg. However, upon examination of the code, it becomes apparent that if the only available short is priced greater than the oracle price by 1%, the transaction still proceeds without reversion.
The _updateOracleAndStartingShort
function will be called through the updateOracleAndStartingShortViaThreshold
while the _createBid
function is being executed.
If minted too high from the oracle price the asset could lose its peg.
Manual review
Implement a mechanism to exclude shorts from being matched if their price deviates by more than 1% from the oracle's price.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.