CollateralManager
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
Constructor to initialize the Collateral Manager
Parameters
_vault
address
Address of the Vault contract
Register a collateral for mint & redeem in USDs
Parameters
_collateral
address
Address of the collateral
_data
CollateralBaseData
Collateral configuration data
Update existing collateral configuration
Parameters
_collateral
address
Address of the collateral
_updateData
CollateralBaseData
Updated configuration for the collateral
Un-list a collateral
Parameters
_collateral
address
Address of the collateral
Add a new strategy to collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
_allocationCap
uint16
Allocation capacity
Update existing strategy for collateral
Parameters
_collateral
address
Address of the collateral
_strategy
address
Address of the strategy
_allocationCap
uint16
Allocation capacity
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
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.
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
Get the required data for mint
Parameters
_collateral
address
Address of the collateral
Returns
mintData
CollateralMintData
mintData
Get the required data for USDs redemption
Parameters
_collateral
address
Address of the collateral
Returns
redeemData
CollateralRedeemData
redeemData
Gets a list of all listed collaterals
Returns
address[]
List of addresses representing all listed collaterals
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
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
Get the amount of collateral in all Strategies
Parameters
_collateral
address
Address of the collateral
Returns
amountInStrategies
uint256
amountInStrategies
Get the amount of collateral in vault
Parameters
_collateral
address
Address of the collateral
Returns
amountInVault
uint256
amountInVault
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