Skip to content

Commit

Permalink
Merge pull request #695 from liquity/params
Browse files Browse the repository at this point in the history
feat: final parameter tweaks
  • Loading branch information
danielattilasimon authored Jan 15, 2025
2 parents ec471ba + aa58adc commit 2bccee2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contracts/src/Dependencies/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ uint256 constant COLL_GAS_COMPENSATION_CAP = 2 ether; // Max coll gas compensati
uint256 constant MIN_DEBT = 2000e18;

uint256 constant MIN_ANNUAL_INTEREST_RATE = _1pct / 2; // 0.5%
uint256 constant MAX_ANNUAL_INTEREST_RATE = _100pct;
uint256 constant MAX_ANNUAL_INTEREST_RATE = 250 * _1pct;

// Batch management params
uint128 constant MAX_ANNUAL_BATCH_MANAGEMENT_FEE = uint128(_100pct / 10); // 10%
uint128 constant MIN_INTEREST_RATE_CHANGE_PERIOD = 120 seconds; // prevents more than one adjustment per ~10 blocks
uint128 constant MIN_INTEREST_RATE_CHANGE_PERIOD = 1 hours; // only applies to batch managers / batched Troves

uint256 constant REDEMPTION_FEE_FLOOR = _1pct / 2; // 0.5%

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/interestBatchManagement.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ contract InterestBatchManagementTest is DevTestSetup {
LatestTroveData memory trove = troveManager.getLatestTroveData(troveId);
uint256 annualInterestRate = trove.annualInterestRate;

uint256 newAnnualInterestRate = 101e16;
uint256 newAnnualInterestRate = MAX_ANNUAL_INTEREST_RATE + 1;
assertEq(tmBatchManagerAddress, B, "Wrong batch manager in TM");
assertNotEq(newAnnualInterestRate, annualInterestRate, "New interest rate should be different");

Expand Down
6 changes: 4 additions & 2 deletions contracts/test/interestIndividualDelegation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ contract InterestIndividualDelegationTest is DevTestSetup {
// Set batch manager (B)
vm.startPrank(A);
vm.expectRevert(BorrowerOperations.InterestRateTooHigh.selector);
borrowerOperations.setInterestIndividualDelegate(troveId, C, 1e16, 101e16, 0, 0, 0, 10000e18, 0);
borrowerOperations.setInterestIndividualDelegate(
troveId, C, 1e16, uint128(MAX_ANNUAL_INTEREST_RATE) + 1, 0, 0, 0, 10000e18, 0
);
vm.stopPrank();
}

Expand Down Expand Up @@ -247,7 +249,7 @@ contract InterestIndividualDelegationTest is DevTestSetup {
vm.stopPrank();

// Try to switch to individual delegate (C) along with new interest
uint256 newAnnualInterestRate = 101e16;
uint256 newAnnualInterestRate = MAX_ANNUAL_INTEREST_RATE + 1;
vm.startPrank(A);
vm.expectRevert(BorrowerOperations.InterestRateTooHigh.selector);
borrowerOperations.setInterestIndividualDelegate(
Expand Down

0 comments on commit 2bccee2

Please sign in to comment.