HybridPool ’s flashSwap sends entire fee to barFeeTo
The flashSwap function in HybridPool sends the entire trade fee to the barFeeTo address instead of only the barFee portion. This means liquidity providers receive no fees when flashSwap is used, removing the incentive to provide liquidity.
Submitted by cmichel, also found by 0xsanson
The HybridPool.flashSwap function sends the entire trade fees fee to the barFeeTo. It should only send barFee * fee to the barFeeTo address.
Impact
LPs are not getting paid at all when this function is used. There is no incentive to provide liquidity.
Recommended Mitigation Steps
The flashSwap function should use the same fee mechanism as swap and only send barFee * fee / MAX_FEE to the barFeeTo. See _handleFee function.
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 flashSwap function does not apply the same fee-splitting logic as the swap function, sending the full fee instead of only the barFee portion.
Impact
Liquidity providers receive no fees when flashSwap is used, which could remove the incentive to provide liquidity.
What the attacker needed
None
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 a liquidity pool, traders pay a fee that is shared among liquidity providers and sometimes a protocol fee collector. Here, the flashSwap function mistakenly sends the whole fee to the protocol fee collector, so liquidity providers get nothing. This discourages people from putting their money into the pool.
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.