Skip to content

Commit

Permalink
fix: use correct termination date
Browse files Browse the repository at this point in the history
  • Loading branch information
SidestreamStrongStrawberry committed Aug 8, 2024
1 parent 6f9698f commit 2b283b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/DssSpell.sol
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ contract DssSpellAction is DssAction {

// Note: Bump Oracle price to account for new SF
// Note: the formula is `Debt ceiling * [ (1 + RWA stability fee ) ^ (minimum deal duration in years) ] * liquidation ratio`
// Since RWA001-A Termination Date is `July 2025`, and spell execution time is `2024-08-08`, the distance is `356` days
// bc -l <<< 'scale=18; 15000000 * e(l(1.09) * (356/365)) * 1.00' | cast --to-wei
// Since RWA001-A Termination Date is `July 29, 2025`, and spell execution time is `2024-08-12`, the distance is `356` days
// bc -l <<< 'scale=18; 15000000 * e(l(1.09) * (352/365)) * 1.00' | cast --to-wei
RwaLiquidationLike(MIP21_LIQUIDATION_ORACLE).bump(
"RWA001-A",
16_315_294_289387650080000000
16_299_893_185222593795000000
);

// Note: Update collateral price to propagate the changes
Expand Down
6 changes: 3 additions & 3 deletions src/DssSpell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -934,12 +934,12 @@ contract DssSpellTest is DssSpellTestBase {

// Get the oracle address
(,address pip,, ) = oracle.ilks("RWA001-A");
assertEq(uint256(DSValueAbstract(pip).read()), 16_315_294_289387650080000000, "RWA001: Bad pip value after bump()");
assertEq(uint256(DSValueAbstract(pip).read()), 16_299_893_185222593795000000, "RWA001: Bad pip value after bump()");

// Get collateral's parameters
(uint256 Art, uint256 rate, uint256 spotAfter, uint256 line, ) = vat.ilks("RWA001-A");

assertEq(spotAfter, 16_315_294_289387650080000000 * (RAY / WAD), "RWA001: Bad spot value after bump()");
assertEq(spotAfter, 16_299_893_185222593795000000 * (RAY / WAD), "RWA001: Bad spot value after bump()");

// No more room for new debt
assertGt(Art * rate, line, "RWA001: No more room for new debt");
Expand All @@ -953,7 +953,7 @@ contract DssSpellTest is DssSpellTestBase {
RwaUrnLike(urn).hope(address(this));

uint256 daiToPay = (art * rate) / RAY + 1; // extra wei rounding
GodMode.setBalance(dai, address(urn), daiToPay);
GodMode.setBalance(dai, urn, daiToPay);

RwaUrnLike(urn).wipe(daiToPay);
(, uint256 afterArt) = vat.urns("RWA001-A", urn);
Expand Down

0 comments on commit 2b283b7

Please sign in to comment.