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);
}buyInsurance
buyInsurancePurchases 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 insurancereturns: the amount of insurance tokens received
sellInsurance
sellInsuranceSells 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 tokenreturns: the amount of underling tokens received following the sale
getCostOfInsurance
getCostOfInsuranceCalculates 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 determinedreturns: the amount of the underling tokens needed to pay for the
amountof insurance tokens provided
isActive
isActiveChecks the expiration status of the insurance token
function isActive() external returns (bool)returns: Returns true if insurance token has NOT expired
Last updated