Skip to content

Commit

Permalink
Modify computation of quotetoken amount in TakerActions.sol
Browse files Browse the repository at this point in the history
to compute bond reward accurately for collateral constrained
takes with collateral tokens with decimals != 18.
  • Loading branch information
mwc committed Dec 15, 2023
1 parent 3f29c40 commit 157faca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/external/TakerActions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ library TakerActions {
vars.t0RepayAmount = vars.t0BorrowerDebt;
vars.unscaledQuoteTokenAmount = Math.mulDiv(vars.collateralAmount, netRewardedPrice, vars.bucketScale);

vars.quoteTokenAmount = Maths.wdiv(vars.borrowerDebt, Maths.WAD - takePenaltyFactor);
vars.quoteTokenAmount = Math.mulDiv(vars.collateralAmount, borrowerPrice, Maths.WAD - takePenaltyFactor);
} else {
// collateral available is constraint
vars.collateralAmount = totalCollateral_;
Expand Down

0 comments on commit 157faca

Please sign in to comment.