File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -64,16 +64,9 @@ interface IModuleIssuanceHookV2 {
64
64
65
65
/**
66
66
* Adjustments should return the NET CHANGE in POSITION UNITS for each component in the SetToken's
67
- * components array. Each entry in the returned arrays should index to the same component in the
68
- * SetToken's components array (called using getComponents()). Directional adjustments should be made
69
- * according to the following table (i.e. returning a negative debt number means debt is reduced during
70
- * issue/redeem):
71
- * | ------------------------------------|
72
- * | Type | Positive | Negative |
73
- * | ----- |---------- | --------------|
74
- * | Equity | Add Equity| Equity Reduced|
75
- * | Debt | Add Debt | Debt Reduced |
76
- * | ------------------------------------|
67
+ * components array (i.e. if debt is greater than current debt position unit return negative number).
68
+ * Each entry in the returned arrays should index to the same component in the SetToken's components
69
+ * array (called using getComponents()).
77
70
*/
78
71
function getRedemptionAdjustments (
79
72
ISetToken _setToken ,
Original file line number Diff line number Diff line change @@ -305,6 +305,9 @@ contract SlippageIssuanceModule is DebtIssuanceModule {
305
305
uint256 [] memory totalDebtUnits = new uint256 [](components.length );
306
306
for (uint256 i = 0 ; i < components.length ; i++ ) {
307
307
// NOTE: If equityAdjustment is negative and exceeds equityUnits in absolute value this will revert
308
+ // When adjusting units if we have MORE equity as a result of issuance (ie adjustment is positive) we want to add that
309
+ // to the unadjusted equity units hence we use addition. Vice versa if we want to remove equity, the adjustment is negative
310
+ // hence adding adjusts the units lower
308
311
uint256 adjustedEquityUnits = equityUnits[i].toInt256 ().add (_equityAdjustments[i]).toUint256 ();
309
312
310
313
// Use preciseMulCeil to round up to ensure overcollateration when small issue quantities are provided
@@ -314,6 +317,9 @@ contract SlippageIssuanceModule is DebtIssuanceModule {
314
317
adjustedEquityUnits.preciseMul (_quantity);
315
318
316
319
// NOTE: If debtAdjustment is negative and exceeds debtUnits in absolute value this will revert
320
+ // When adjusting units if we have MORE debt as a result of issuance (ie adjustment is negative) we want to increase
321
+ // the unadjusted debt units hence we subtract. Vice versa if we want to remove debt the adjustment is positive
322
+ // hence subtracting adjusts the units lower.
317
323
uint256 adjustedDebtUnits = debtUnits[i].toInt256 ().sub (_debtAdjustments[i]).toUint256 ();
318
324
319
325
// Use preciseMulCeil to round up to ensure overcollateration when small redeem quantities are provided
You can’t perform that action at this time.
0 commit comments