Skip to main content

InsuranceFund

Functions

initialize

  function initialize(
) external

setVault

  function setVault(
) external

setDistributionThreshold

  function setDistributionThreshold(
) external

setSurplusBeneficiary

  function setSurplusBeneficiary(
) external

repay

  function repay(
) external

If insurance has negative accountValue of vault, will deposit amount to vault

distributeFee

  function distributeFee(
) external returns (uint256)

If balance of InsuranceFund is over distributionThreshold, transfer diff to SurplusBeneficiary

Insurance Fund should only distribute revenues surplus earned on the platform. In other words, funds directly held in the Insurance Fund contract (insuranceFundWalletBalance) contributes to insuranceFundTotalBalance but not necessarily to surplus. Anyone can send funds to Insurance Fund and help it reach distributionThreshold sooner, but once surplus exceeds the revenues earned on the platform (insuranceFundFreeCollateral), sending more funds won’t increase surplus further

Return Values:

NameTypeDescription
surplusuint256The surplus of distribution

getToken

  function getToken(
) external returns (address)

Get settlement token address

Return Values:

NameTypeDescription
tokenaddressThe address of settlement token

getBorrower

  function getBorrower(
) external returns (address)

(Deprecated function, will be removed in the next release), Get borrower(Vault) address

Return Values:

NameTypeDescription
vaultaddressThe address of Vault

getVault

  function getVault(
) external returns (address)

Get Vault address

Return Values:

NameTypeDescription
vaultaddressThe address of Vault

getDistributionThreshold

  function getDistributionThreshold(
) external returns (uint256)

Get insurance distributution threshold, this value is for fee distribution

Return Values:

NameTypeDescription
distributionThresholduint256The distribution threshold number

getSurplusBeneficiary

  function getSurplusBeneficiary(
) external returns (address)

Get SurplusBeneficiary

Return Values:

NameTypeDescription
surplusBeneficiaryaddressThe address of SurplusBeneficiary

getInsuranceFundCapacity

  function getInsuranceFundCapacity(
) public returns (int256)

Get InsuranceFund capacity

Return Values:

NameTypeDescription
capacityX10_Sint256The capacity value (settlementTokenValue + walletBalance) in settlement token's decimals