Submitted by cmichel.
The PoolKeeper.keeperReward computation mixes WADs and Quads which leads to issues.
It tries to compute _keeperGas + _keeperGas * _tipPercent and to compute _keeperGas * _tipPercent it does a wrong division by fixedPoint (1e18 as a quad value) because it thinks the _tipPercent is a WAD value (100%=1e18) as a quad, when indeed 100%=100. It seems like it should divide by 100 as a quad instead.
The keeper rewards are off as the _keeperGas * _tipPercent is divided by 1e18 instead of 1e2.
Keeper will just receive their _keeperGas cost but the tip part will be close to zero every time.
Generally, Id say the contract mixes quad and WAD units where it doesnt have to do it. Usually, you either use WAD or Quad math but not both at the same time.
This complicates the code.
Id make keeperTip()  return a byte16 Quad value as a percentage where 100% = ABDKMathQuad.fromUInt(1). This temporary float result can then be used in a different ABDKMathQuad computation.
Alternatively, divide by 100 as a quad instead of 1e18 as a quad because _tipPercent is not a WAD value, but simply a percentage where 1 = 1%.
mynameuhh (Tracer) confirmed
Alex the Entreprenerd (judge) commented:
