RebaseManager
Inherits: IRebaseManager, Ownable
Author: Sperax Foundation
This contract handles the configuration and execution of the rebasing mechanism for the USDs stablecoin. It ensures that rebases occur only when certain prerequisites are fulfilled, such as the time gap between rebases and acceptable APR (Annual Percentage Rate) ranges.
The Rebase Manager coordinates with the Vault and Dripper contracts to manage the rebase process.
State Variables
ONE_YEAR
vault
dripper
gap
aprCap
aprBottom
lastRebaseTS
Functions
onlyVault
constructor
Constructor to initialize the Rebase Manager
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Address of the vault contract |
_dripper | address | Address of the dripper contract for collecting USDs |
_gap | uint256 | Minimum time gap required between two consecutive rebases |
_aprCap | uint256 | Maximum allowed APR for a rebase |
_aprBottom | uint256 | Minimum allowed APR for a rebase |
fetchRebaseAmt
Get the current amount valid for rebase
Function is called by the vault while rebasing
Returns
Name | Type | Description |
---|---|---|
uint256 | The available amount for rebasing USDs |
updateVault
Updates the vault address
Parameters
Name | Type | Description |
---|---|---|
_newVault | address | Address of the new vault contract |
updateDripper
Updates the dripper contract for USDs vault
Parameters
Name | Type | Description |
---|---|---|
_dripper | address | Address of the new dripper contract |
updateGap
Update the minimum time gap required between two rebases
Parameters
Name | Type | Description |
---|---|---|
_gap | uint256 | Updated gap time |
updateAPR
Update the APR requirements for each rebase
Parameters
Name | Type | Description |
---|---|---|
_aprBottom | uint256 | New minimum APR for a rebase |
_aprCap | uint256 | New maximum APR for a rebase |
getAvailableRebaseAmt
Gets the current available rebase fund
Returns
Name | Type | Description |
---|---|---|
uint256 | Current balance in the vault plus collectable dripped USDs amount |
getMinAndMaxRebaseAmt
Gets the minimum and maximum rebase USDs amount based on the APR config
Returns
Name | Type | Description |
---|---|---|
uint256 | Minimum and maximum rebase amounts | |
uint256 |
Events
VaultUpdated
DripperUpdated
GapUpdated
APRUpdated
Errors
CallerNotVault
InvalidAPRConfig
Last updated