Submitted by GreyArt, also found by broccoli
A mint fee is applied whenever unbalanced liquidity is added, because it is akin to swapping the excess token amount for the other token.
However, the current implementation distributes the minted fee to the minter as well (when he should be excluded). It therefore acts as a rebate of sorts.
As a result, it makes adding and removing liquidity as opposed to swapping directly (negligibly) more desirable. An example is given below using the Constant Product Pool to illustrate this point. The Hybrid pool exhibits similar behaviour.
The mint fee should be distributed to existing LPs first, by incrementing _reserve0 and _reserve1 with the fee amounts. The rest of the calculations follow after.
ConstantProductPool
HybridPool
maxsam4 (Sushi) confirmed
