IInsurance
The IInsurance interface makes it easy for developers to build custom support for any insurnace token protocol.
All insurance adapters must inherit from and adhere to the
IInsurance
interface.interface IInsurance {
function buyInsurance(uint256 amount) external returns (uint256);
function sellInsurance(uint256 amount) external returns (uint256);
function getCostOfInsurance(uint256 amount) external view returns (uint256);
function isActive() external returns (bool);
}
Purchases the insurance tokens with the underlying token (e.g., DAI)
function buyInsurance(uint256 amount) external returns (uint256)
- parameter:
amount
, the amount of underlying tokens used to buy insurance - returns: the amount of insurance tokens received
Sells the insurance tokens in return for the underlying token (e.g., DAI)
function sellInsurance(uint256 amount) external returns (uint256)
- parameter:
amount
, the amount of insurance tokens that will be sold for the underlying token - returns: the amount of underling tokens received following the sale
Calculates the cost of premiums to be paid in order to obtain coverage
function getCostOfInsurance(uint256 amount) external view returns (uint256)
- parameter:
amount
, the amount of insurance tokens for which the cost of premiums is determined - returns: the amount of the underling tokens needed to pay for the
amount
of insurance tokens provided
Checks the expiration status of the insurance token
function isActive() external returns (bool)
- returns: Returns true if insurance token has NOT expired
Last modified 2yr ago