Skip to content
Business logic Audit finding Intermediate

Liquidators will not be incentivized to liquidate certain PartyB accounts due to the lack of incentives

The liquidation function for PartyB accounts sets the liquidator's share to zero when the account's loss exceeds the liquidation fee, so liquidators receive no reward for performing the liquidation. This lack of incentive may cause liquidations to be delayed or skipped, exposing PartyB to additional risk.

Ch_301 Follow with Ruhum, berndartmueller and 3 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-06-symmetrical-judging/issues/234

Found by

Ch_301, Ruhum, berndartmueller, mstpr-brainbot, rvierdiiev, xiaoming90

Summary

Liquidating certain accounts does not provide a liquidation fee to the liquidators. Liquidators will not be incentivized to liquidate such accounts, which may lead to liquidation being delayed or not performed, exposing Party B to unnecessary risks and potentially resulting in greater asset losses than anticipated.

Vulnerability Detail

https://github.com/sherlock-audit/2023-06-symmetrical/blob/main/symmio-core/contracts/facets/liquidation/LiquidationFacetImpl.sol#L269

Solidity
File: LiquidationFacetImpl.sol
240:     function liquidatePartyB(
..SNIP..
259:         if (uint256(-availableBalance) < accountLayout.partyBLockedBalances[partyB][partyA].lf) {
260:             remainingLf =
261:                 accountLayout.partyBLockedBalances[partyB][partyA].lf -
262:                 uint256(-availableBalance);
263:             liquidatorShare = (remainingLf * maLayout.liquidatorShare) / 1e18;
264: 
265:             maLayout.partyBPositionLiquidatorsShare[partyB][partyA] =
266:                 (remainingLf - liquidatorShare) /
267:                 quoteLayout.partyBPositionsCount[partyB][partyA];
268:         } else {
269:             maLayout.partyBPositionLiquidatorsShare[partyB][partyA] = 0;
270:         }

Assume that the loss of Party B is more than the liquidation fee. In this case, the else branch of the above code within the liquidatePartyB function will be executed. The liquidatorShare and partyBPositionLiquidatorsShare variables will both be zero, which means the liquidators will get nothing in return for liquidating PartyBs

As a result, there will not be any incentive for the liquidators to liquidate such positions.

Impact

Liquidators will not be incentivized to liquidate those accounts that do not provide them with a liquidation fee. As a result, the liquidation of those accounts might be delayed or not performed at all. When liquidation is not performed in a timely manner, PartyB ended up taking on additional unnecessary risks that could be avoided in the first place if a different liquidation incentive mechanism is adopted, potentially leading to PartyB losing more assets than expected.

Although PartyBs are incentivized to perform liquidation themselves since it is the PartyBs that take on the most risks from the late liquidation, the roles of PartyB and liquidator are clearly segregated in the protocol design. Only addresses granted the role of liquidators can perform liquidation as the liquidation functions are guarded by onlyRole(LibAccessibility.LIQUIDATOR_ROLE). Unless the contracts are implemented in a manner that automatically grants a liquidator role to all new PartyB upon registration OR liquidation functions are made permissionless, PartyBs are likely not able to perform the liquidation themselves when the need arises.

Moreover, the PartyBs are not expected to be both a hedger and liquidator simultaneously as they might not have the skillset or resources to maintain an infrastructure for monitoring their accounts/positions for potential late liquidation.

Code Snippet

https://github.com/sherlock-audit/2023-06-symmetrical/blob/main/symmio-core/contracts/facets/liquidation/LiquidationFacetImpl.sol#L269

Tool used

Manual Review

Recommendation

Considering updating the liquidation incentive mechanism that will always provide some incentive for the liquidators to take the initiative to liquidate insolvent accounts. This will help to build a more robust and efficient liquidation mechanism for the protocols. One possible approach is to always give a percentage of the CVA of the liquidated account as a liquidation fee to the liquidators.

Discussion

MoonKnightDev

If we encounter a late liquidation, our incentives are as follows:

If Party B or Party A, which is linked with only one counterparty, undergoes liquidation, and there is an isolated environment between the two, and in any case, all the funds transfer from one side to the other, so the liquidation time is not important anymore. And in a way, late liquidation is meaningless here.

Hence, one of the parties or any interested party can call this. If the individual being liquidated is connected with multiple counterparties, the remaining counterparties would call this liquidation to prevent further losses.

These can be called for when it is not beneficial for the liquidator.

But in general, we plan to always have incentives for liquidators

hrishibhat

@xiaoming9090

xiaoming9090

If we encounter a late liquidation, our incentives are as follows:

If Party B or Party A, which is linked with only one counterparty, undergoes liquidation, and there is an isolated environment between the two, and in any case, all the funds transfer from one side to the other, so the liquidation time is not important anymore. And in a way, late liquidation is meaningless here.

Hence, one of the parties or any interested party can call this. If the individual being liquidated is connected with multiple counterparties, the remaining counterparties would call this liquidation to prevent further losses.

These can be called for when it is not beneficial for the liquidator.

But in general, we plan to always have incentives for liquidators

In the second scenario where the liquidator does not perform the liquidation due to lack of incentives, the sponsor expects that the counterparty will call the liquidation themselves in order to prevent further losses. This seems reasonable on design, however, the implementation of current system does not allow the counterparty to do so.

As mentioned in my report and other Watson reports (https://github.com/sherlock-audit/2023-06-symmetrical-judging/issues/296),

Although PartyBs are incentivized to perform liquidation themselves since it is the PartyBs that take on the most risks from the late liquidation, the roles of PartyB and liquidator are clearly segregated in the protocol design. Only addresses granted the role of liquidators can perform liquidation as the liquidation functions are guarded by onlyRole(LibAccessibility.LIQUIDATOR_ROLE). Unless the contracts are implemented in a manner that automatically grants a liquidator role to all new PartyB upon registration OR liquidation functions are made permissionless, PartyBs are likely not able to perform the liquidation themselves when the need arises.

In short, the counterparty (PartyA or PartyB) could not perform the liquidation required as mentioned by the sponsor in the second scenario because they are not granted the role of liquidator by default. Thus, this issue is still valid.

hrishibhat

@MoonKnightDev

shaka0x

Escalate.

In case liquidators are not incentiviced to perform the liquidation, the liquidator bots from the protocol will perform the task. From the README file:

Q: Are there any off-chain mechanisms or off-chain procedures for the protocol (keeper bots, input validation expectations, etc)? Liquidator Bots, Force close Bots, Force cancel Bots, Anomaly detector Bots

I have commented on this fact in the issues #181 and #182:

There is no incentive for liquidators to liquidate the position, since the liquidation fee is 0. So it will have to be done by the liquidator bot.
An important remark is that some liquidation processes do not have economic incentives for the liquidator, so in this cases the liquidation process relies completely on the protocol bots. 

But this is not an issue on its own.

sherlock-admin2

Escalate.

In case liquidators are not incentiviced to perform the liquidation, the liquidator bots from the protocol will perform the task. From the README file:

Q: Are there any off-chain mechanisms or off-chain procedures for the protocol (keeper bots, input validation expectations, etc)? Liquidator Bots, Force close Bots, Force cancel Bots, Anomaly detector Bots

I have commented on this fact in the issues #181 and #182:

There is no incentive for liquidators to liquidate the position, since the liquidation fee is 0. So it will have to be done by the liquidator bot.
An important remark is that some liquidation processes do not have economic incentives for the liquidator, so in this cases the liquidation process relies completely on the protocol bots. 

But this is not an issue on its own.

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

xiaoming9090

Escalate.

In case liquidators are not incentiviced to perform the liquidation, the liquidator bots from the protocol will perform the task. From the README file:

Q: Are there any off-chain mechanisms or off-chain procedures for the protocol (keeper bots, input validation expectations, etc)? Liquidator Bots, Force close Bots, Force cancel Bots, Anomaly detector Bots

I have commented on this fact in the issues #181 and #182:

There is no incentive for liquidators to liquidate the position, since the liquidation fee is 0. So it will have to be done by the liquidator bot.
An important remark is that some liquidation processes do not have economic incentives for the liquidator, so in this cases the liquidation process relies completely on the protocol bots. 

But this is not an issue on its own.

The system is design to have liquidation performed by others, not by the protocol itself.

shaka0x

The system is design to have liquidation performed by others, not by the protocol itself.

That is not true. Apart from the mentioned entry in the README file, the docs also state that there are additional mechanisms beyond 3rd party liquidators.

After the trade is executed both parties have to constantly ensure that their collateral and margin is sufficient to keep the trade open, 3rd party liquidators, watchdogs and other tools help to ensure that solvency of all parties in the system is given at all time.

abanchev

Watchdogs and other tools also refers to tools used by party B to ensure they are not liquidated themselves (alerts to notify them to supply more collateral if necessary). Protocol provides the tools for others to use, the protocol may also run a liquidator bot for extra profit but the goal is a system where everything is permissionless.

Navid-Fkh

We don't consider this to be an issue. In the early stages, when we are restricted to trusted liquidators, we will have no problems as the liquidator will do the job. If we ever get to a permissionless system for liquidators, then any PartyB should likely run their own liquidator to prevent such situations.

hrishibhat

Result: Medium Has duplicates From the readme it is clear that the Liquidator is not trusted and not owned by the protocol. The liquidators bots are incentivized by the protocol to do their actions, however, this is a valid issue where there is a flaw in this mechanism

sherlock-admin2

Escalations have been resolved successfully!

Escalation status:

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

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 liquidation logic sets the liquidator's share to zero when the account's loss exceeds the liquidation fee, removing any financial incentive to liquidate.

Impact

Liquidators may delay or skip liquidating such accounts, potentially leading to greater asset losses for PartyB.

What the attacker needed

Liquidator role required; PartyB account with loss exceeding fee

The fix

The liquidation incentive mechanism should be updated to always provide some incentive, for example by giving a percentage of the CVA as a liquidation fee.

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.

In some financial smart contracts, when a trader's account becomes unsafe, a 'liquidator' steps in to close the position and gets a fee for doing so. This report found that for certain accounts, the fee is set to zero, so no one has a reason to do the job. As a result, the risky position might stay open longer than it should, which could cause bigger losses.

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 Ch_301

View all

39 more disclosed reports, best first.

More from Symmetrical Update

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.