CollateralManager
Inherits: ICollateralManager, Ownable
Author: Sperax Foundation
This contract manages the addition and removal of collateral, configuration of collateral strategies, and allocation percentages.
Collateral Manager interacts with the Vault and various strategies for collateral management.
State Variables
collateralCompositionUsed
VAULT
collaterals
collateralInfo
collateralStrategyInfo
collateralStrategies
Functions
constructor
Constructor to initialize the Collateral Manager
Parameters
_vault
address
Address of the Vault contract
addCollateral
Register a collateral for mint & redeem in USDs
Parameters
_collateral
address
Address of the collateral
_data
CollateralBaseData
Collateral configuration data
updateCollateralData
Update existing collateral configuration
Parameters
_collateral
address
Address of the collateral
_updateData
CollateralBaseData
Updated configuration for the collateral
removeCollateral
Un-list a collateral
Parameters
_collateral
address
Address of the collateral
addCollateralStrategy
Add a new strategy to collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
_allocationCap
uint16
Allocation capacity
updateCollateralStrategy
Update existing strategy for collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
_allocationCap
uint16
Allocation capacity
removeCollateralStrategy
Remove an existing strategy from collateral
Ensure all the collateral is removed from the strategy before calling this Otherwise it will create error in collateral accounting
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
updateCollateralDefaultStrategy
validateAllocation
Validate allocation for a collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the desired strategy
_amount
uint256
Amount to be allocated.
Returns
bool
True for valid allocation request.
getFeeCalibrationData
Get the required data for mint
Parameters
_collateral
address
Address of the collateral
Returns
uint16
Base fee config for collateral (baseMintFee, baseRedeemFee, composition, totalCollateral)
uint16
uint16
uint256
getMintParams
Get the required data for mint
Parameters
_collateral
address
Address of the collateral
Returns
mintData
CollateralMintData
mintData
getRedeemParams
Get the required data for USDs redemption
Parameters
_collateral
address
Address of the collateral
Returns
redeemData
CollateralRedeemData
redeemData
getAllCollaterals
Gets a list of all listed collaterals
Returns
address[]
List of addresses representing all listed collaterals
getCollateralStrategies
Gets a list of all strategies linked to a collateral
Parameters
_collateral
address
Address of the collateral
Returns
address[]
List of addresses representing available strategies for the collateral
isValidStrategy
Verifies if a strategy is linked to a collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
Returns
bool
True if the strategy is linked to the collateral, otherwise False
getCollateralInStrategies
Get the amount of collateral in all Strategies
Parameters
_collateral
address
Address of the collateral
Returns
amountInStrategies
uint256
amountInStrategies
getCollateralInVault
Get the amount of collateral in vault
Parameters
_collateral
address
Address of the collateral
Returns
amountInVault
uint256
amountInVault
getCollateralInAStrategy
Get the amount of collateral allocated in a strategy
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
Returns
allocatedAmt
uint256
Allocated amount
Events
CollateralAdded
CollateralRemoved
CollateralInfoUpdated
CollateralStrategyAdded
CollateralStrategyUpdated
CollateralStrategyRemoved
Errors
CollateralExists
CollateralDoesNotExist
CollateralStrategyExists
CollateralStrategyMapped
CollateralStrategyNotMapped
CollateralNotSupportedByStrategy
CollateralAllocationPaused
CollateralStrategyInUse
AllocationPercentageLowerThanAllocatedAmt
IsDefaultStrategy
Structs
CollateralData
StrategyData
Last updated