Skip to content

Underwater positions have no incentive to be liquidated #177

@bsamuels453

Description

@bsamuels453

Severity: Medium
Difficulty: Medium/High

Liquidations in Overlay are incentivized by paying a liquidation fee to the liquidator that is based on a percentage of the remaining value of the position:

// calculate the liquidation fee as % on remaining value
// sent as reward to liquidator
liquidationFee = value.mulDown(params.get(Risk.Parameters.LiquidationFeeRate));
marginRemaining = value - liquidationFee;

However, the value of a position may be "underwater," and its value clamped down to zero:

uint256 fraction,
uint256 oiTotalOnSide,
uint256 oiTotalSharesOnSide,
uint256 currentPrice,
uint256 capPayoff
) internal pure returns (uint256 val_) {
uint256 posOiInitial = oiInitial(self, fraction);
uint256 posNotionalInitial = notionalInitial(self, fraction);
uint256 posDebt = debtInitial(self, fraction);

This means underwater positions have no incentive to be liquidated, and bad positions may remain in the system. While the maintenance margin does provide a buffer on the positions value to prevent positions from going underwater before liquidation, it's possible for the maintenance margin to be fully consumed during a tail-risk event, such as a large price swing after the rollup sequencer has been offline for a duration.

Exploit Scenarios (most likely to least)

A rollup sequencer outage is followed by a large-swing oracle price update, instantly consuming the entire maintenance margin of weak positions.
A large spike in gas fees from an NFT mint leads to a liquidatable position not being liquidated while its maintenance margin decays.

Recommendation

Short term, Overlay should run its own liquidator bot that detects and liquidates underwater positions to prevent toxic debt from coalescing.

Long term, build an emergency liquidation fund mechanism that can pay out a minimum liquidation fee for underwater positions. This mechanism would have to be be relatively complex to avoid manipulation, so it should not be implemented as a short-term mitigation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions