Skip to content
Business logic Audit finding Intermediate

Possible attacks on Seconds * Liquidity calculation

The report describes a possible attack on a staking contract where a user can mint a tight-range liquidity position, claim rewards, then burn and re-mint at a new price to continuously earn incentives without risk. The attacker could steal incentive funds by maintaining a high-liquidity position in the correct price range.

Sushi Trident contest phase 2

Originally disclosed on Code4rena

This is a possible line of attack on the staking contract, in particular the claimReward() function: ConcentratedLiquidityPoolManager.sol#L90 L94

  1. A user with some spare capital mints a liquidity position with a very tight range (1-2 ticks wide) at the current price. Because the range is so small, his position.liquidity on his NFT is large (DyDxMath.sol).
  2. The user then sets up a bot to frontrun any price changes that someone else tries to do, burning his position after claiming rewards. He then mints a new liquidity position at the new price after the other persons trades go through.
  3. Rinse and repeat this process. If done correctly, no funds are at risk from the bot owner, he doesn’t pay any fees for burning/minting either.

So what you have left is a sequence of positions with high position.liquidity and in the correct price range all the time, without taking on any risk. Thereby stealing incentive funds.

The lines below reward the bot owner with a large amount of the token:

ConcentratedLiquidityPoolManager.sol#L90 L94 Recommendation:

Lock the positions during a set time while they are staked.

sarangparikh22 (Sushi) disputed:

This seems very unlikely to happen and does not affect the pool, it’s equivalent to just re balancing your position.

alcueca (judge) commented:

@sarangparikh22 (Sushi), Isn’t the warden describing a Just In Time liquidity pattern?

sarangparikh22 (Sushi) acknowledged:

@alcueca (judge) yes exactly, even done right, the bot would still face huge IL. We don’t intend to solve this.

The original report as published on Code4rena. 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 reward calculation does not account for the duration liquidity is provided, allowing users to claim rewards immediately after minting and then burn to avoid risk.

Impact

The attacker could steal incentive funds by earning rewards without taking on risk, though the project disputes the likelihood and impact.

What the attacker needed

Spare capital; ability to frontrun transactions

The fix

The reporter recommends locking positions during a set time while they are staked, but the project does not intend to fix it.

How it was found

  1. Mint a liquidity position with a very tight range (1-2 ticks wide) at the current price.
  2. Set up a bot to frontrun any price changes, burning the position after claiming rewards.
  3. Mint a new liquidity position at the new price after the other person's trades go through.
  4. Repeat the process to continuously earn rewards without risk.

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.

This is about a smart contract that rewards people for providing liquidity (crypto tokens) to a trading pool. The report suggests someone could game the system by constantly moving their liquidity to always be in the rewarded range, collecting rewards without really helping the pool. The project team thinks it's unlikely and not a real problem.

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 from Sushi Trident contest phase 2

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.