Skip to content
Business logic Audit finding Intermediate

Inefficiency in the Dutch Auction due to lower duration

The Dutch auction price calculation reaches the reserve strike before the full 24-hour duration, leaving the price constant for the remaining time. This reduces the effective auction period and can cause options to be filled at unfavourable prices for the vault creator.

hubble Follow

Originally disclosed on Code4rena

Submitted by hubble, also found by Hawkeye and sseefried

The vulnerability or bug is in the implementation of the function getDutchAuctionStrike() The AUCTION_DURATION is defined as 24 hours, and consider that the dutchAuctionReserveStrike (or reserveStrike) will never be set to 0 by user.

Now if a vault is created with startingStrike value of 55 and reserveStrike of 13.5 , the auction price will drop from 55 to 13.5 midway at ~12 hours. So, after 12 hours from start of auction, the rate will be constant at reserveStrike of 13.5, and remaining time of 12 hours of auction is a waste.

Some other examples :

startStrike, reserveStrike, time-to-reach-reserveStrike
55 , 13.5  , ~12 hours
55 , 5     , ~16.7 hours
55 , 1.5   , ~20 hours
5  , 1.5   , ~11 hours

Impact

The impact is high wrt Usability, where users have reduced available time to participate in the auction (when price is expected to change). The vault-Creators or the option-Buyers may or may not be aware of this inefficiency, i.e., how much effective time is available for auction.

Proof of Concept

Contract : Cally.sol Function : getDutchAuctionStrike ()

Recommended Mitigation Steps

The function getDutchAuctionStrike() can be modified such that price drops to the reserveStrike exactly at 24 hours from start of auction.

        /*
            delta = max(auctionEnd - currentTimestamp, 0)
            progress = delta / auctionDuration
            auctionStrike = progress^2 * (startingStrike - reserveStrike)             << Changes here
            strike = auctionStrike + reserveStrike                                    << Changes here
        */
        uint256 delta = auctionEndTimestamp > block.timestamp ? auctionEndTimestamp - block.timestamp : 0;
        uint256 progress = (1e18 * delta) / AUCTION_DURATION;
        uint256 auctionStrike = (progress * progress * (startingStrike-reserveStrike)) / (1e18 * 1e18);

        strike = auctionStrike + reserveStrike;

outdoteth (Cally) confirmed, disagreed with severity and commented:

We think this should be bumped to high severity. It would be easy for a user to create an auction that declines significantly faster than what they would have assumed - even over 1 or 2 blocks. It makes no sense for the auction to ever behave in this way and would result in options getting filled at very bad prices for the creator of the vault.

outdoteth (Cally) resolved:

The fix for this issue is here: https://github.com/outdoteth/cally/pull/2

HardlyDifficult (judge) increased severity to High and commented:

The sponsor comment here makes sense. Agree with (1) High since this can potentially be very detrimental to the promise of this protocol.


The original report as published on Code4rena, by hubble. 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 price calculation uses a quadratic formula that reaches the reserve strike before the auction duration ends, instead of linearly decreasing to the reserve at the end.

Impact

The auction price may reach the reserve early, reducing the time when the price changes and potentially causing options to be filled at very bad prices for the vault creator.

What the attacker needed

A vault with startingStrike > reserveStrike; auction duration of 24 hours

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 Dutch auction starts with a high price that goes down over time until it reaches a minimum (reserve) price. The bug is that the price reaches the minimum too early, so for the rest of the auction time the price does not change. This means buyers have less time to bid while the price is still falling, and the seller might get a lower price than expected.

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 hubble

View all

11 more disclosed reports, best first.

More from Cally 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.