Closed grandizzy closed 1 year ago
Regarding
kickWithDeposit
: As much as I like not having to use aMaths.min
to prevent underflow, I am slightly concerned thatkickWithDeposit
does not reuseLenderActions
logic for removing quote token. Seems it would be much cleaner if more of the math for redeeming LP for quote token was shared withremoveQuoteToken
.
that's a good point, I agree that would be the best approach. I quickly looked to see what would imply reusing LenderActions._removeMaxDeposit
and there are quite some changes to be done, I'd like to explore this / test thoroughly in a subsequent PR
Description of change
High level
ceilWdiv
is used). This results in tx reverting and kick with deposit failurefloorWmul
to round down scaled amountF1
andF2
deviation back to1e12
(were changed to quote token scale but this lowers deviation to 1 in case of 18 decimals)ceilMul
when computing amount forF3
(since Fenwick change to allow higher debt but lower precision https://github.com/ajna-finance/contracts/pull/857)1e13
, inline withQT1
invariant deviationContract size
Pre Change
Post Change
Gas usage
Pre Change
Post Change