You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// @dev Checks premium owed does not increase by more than `premiumAmount`.
686
-
/// @dev Checks updated risk premium is within allowed limit.
687
-
/// @dev Can increase premium by 2 wei due to opposite rounding on premium shares and offset.
685
+
/// @dev Checks premium owed does not increase by more than `premiumAmount` + 2 wei (due to opposite rounding on premium shares and offset); reverts with `InvalidPremiumChange()` otherwise.
686
+
/// @dev Checks updated risk premium is within allowed threshold; reverts with `InvalidPremiumChange()` otherwise (even if risk premium decreases).
688
687
function _applyPremiumDelta(
689
688
Asset storageasset,
690
689
SpokeData storagespoke,
@@ -713,10 +712,10 @@ contract Hub is IHub, AccessManaged {
Copy file name to clipboardExpand all lines: src/hub/interfaces/IHub.sol
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ interface IHub is IHubBase, IAccessManaged {
71
71
/// @dev addedShares The added shares of a spoke for a given asset.
72
72
/// @dev addCap The maximum amount that can be added by a spoke, expressed in whole assets (not scaled by decimals). A value of `MAX_ALLOWED_SPOKE_CAP` indicates no cap.
73
73
/// @dev drawCap The maximum amount that can be drawn by a spoke, expressed in whole assets (not scaled by decimals). A value of `MAX_ALLOWED_SPOKE_CAP` indicates no cap.
74
-
/// @dev riskPremiumCap The maximum proportion of drawn shares that a spoke can update, expressed in BPS. A value of `MAX_ALLOWED_RISK_PREMIUM_CAP` indicates no cap.
74
+
/// @dev riskPremiumThreshold The maximum ratio of premium to drawn shares a spoke can have, expressed in BPS. A value of `MAX_RISK_PREMIUM_THRESHOLD` indicates no threshold.
75
75
/// @dev active True if the spoke is prevented from performing any actions.
76
76
/// @dev paused True if the spoke is prevented from performing actions that instantly update the liquidity.
77
77
/// @dev deficit The deficit reported by a spoke for a given asset, expressed in asset units.
@@ -85,7 +85,7 @@ interface IHub is IHubBase, IAccessManaged {
85
85
uint128 addedShares;
86
86
uint40 addCap;
87
87
uint40 drawCap;
88
-
uint24riskPremiumCap;
88
+
uint24riskPremiumThreshold;
89
89
bool active;
90
90
bool paused;
91
91
//
@@ -96,7 +96,7 @@ interface IHub is IHubBase, IAccessManaged {
96
96
struct SpokeConfig {
97
97
uint40 addCap;
98
98
uint40 drawCap;
99
-
uint24riskPremiumCap;
99
+
uint24riskPremiumThreshold;
100
100
bool active;
101
101
bool paused;
102
102
}
@@ -372,5 +372,8 @@ interface IHub is IHubBase, IAccessManaged {
372
372
/// @return The maximum cap value, expressed in asset units.
373
373
function MAX_ALLOWED_SPOKE_CAP() externalviewreturns (uint40);
374
374
375
-
function MAX_ALLOWED_RISK_PREMIUM_CAP() externalviewreturns (uint24);
375
+
/// @notice Returns the maximum value for any spoke risk premium threshold.
376
+
/// @dev The value is not inclusive; using the maximum value indicates no threshold.
377
+
/// @return The maximum risk premium threshold, expressed in BPS.
378
+
function MAX_RISK_PREMIUM_THRESHOLD() externalviewreturns (uint24);
0 commit comments