Skip to content
Business logic Audit finding Intermediate

No mechanism to settle out-of-money put options even after Bond receipt token is redeemed.

The settlement function only burns an option when it is in-the-money, so out-of-money put options tied to bonds that have already been redeemed are never retired. As a result, the core contract keeps paying premiums to vault liquidity providers and their collateral stays locked indefinitely.

0Kage Follow with peakbolt, pep7siup and 3 others

Originally disclosed on Code4rena

Submitted by 0Kage, also found by peakbolt, pep7siup, ABA, 0xnev, and zzebra83

https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L333

https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L800

https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L376

In the current implementation of PerpetualAtlanticVault::settle, the only way an optionId can be burnt is when the option is in-the-money. Note that at the time of bonding, a put option that is 25% out of the money is purchased by user. If the RDPX-ETH price is above this price, the option is rolled over to the next epoch and a new premium is again calculated inside the PerpetualAtlanticVault::calculateFunding and added to the totalFundingForEpoch.

Effectively, as long as the option is out of money, the funding cost continues to be deducted from core contract and passed to Atlantic vault LPs. There is no check if the underlying bond for which this put option is minted is redeemed or not.

Not completely sure if this is bug or feature of Perpetual Atlantic Puts but since the utility of these puts is to protect downside price movements of RDPX during bonding, such options should be retired once the underlying bond is redeemed by user. Paying out a premium on a perennial basis to Atlantic LP’s does not make sense.

Impact

There are 2 implications:

  1. Atlantic vault LPs collateral will be locked so long as option is out of money. This is because optionStrikes[strike] never reduces so long as the option continues to be OTM.
  2. Core contract continues to pay out funding costs for OTM options that cannot be settled.

Recommended Mitigation Steps

Consider settling optionIds that no longer have an underlying bonding. Put options for such bonds should expire and free up locked collateral in Atlantic Vaults.

psytama (Dopex) confirmed


The original report as published on Code4rena, by 0Kage. 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 settlement logic lacks a check for whether the underlying bond has been redeemed, so out-of-money options are rolled over and charged again instead of being expired.

Impact

Vault liquidity providers' collateral remains locked and the core contract continues to pay funding costs for options that cannot be settled, as long as the option stays out of money.

What the attacker needed

A bond is redeemed while its put option is out of money

The fix

The settlement logic should expire and settle option identifiers whose underlying bond has been redeemed, freeing the locked collateral.

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 put option is a kind of insurance that pays out if a price falls. Here, a user buys one when they lock up a bond, but if the price stays high the option is never closed, even after the bond is redeemed. The protocol then keeps charging the core contract for that unused insurance and keeps the vault's funds tied up.

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 0Kage

View all

7 more disclosed reports, best first.

More from Dopex

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.