IInsuranceFund

  function repay(
  ) external

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

distributeFeearrow-up-right

  function distributeFee(
  ) external returns (uint256 surplus)

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:arrow-up-right

Name
Type
Description

surplus

uint256

The surplus of distribution

  function getToken(
  ) external returns (address token)

Get settlement token address

Return Values:arrow-up-right

Name
Type
Description

token

address

The address of settlement token

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

Return Values:arrow-up-right

Name
Type
Description

vault

address

The address of Vault

Get Vault address

Return Values:arrow-up-right

Name
Type
Description

vault

address

The address of Vault

getInsuranceFundCapacityarrow-up-right

Get InsuranceFund capacity

Return Values:arrow-up-right

Name
Type
Description

capacityX10_S

int256

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

getDistributionThresholdarrow-up-right

Get insurance distributution threshold, this value is for fee distribution

Return Values:arrow-up-right

Name
Type
Description

distributionThreshold

uint256

The distribution threshold number

getSurplusBeneficiaryarrow-up-right

Get SurplusBeneficiary

Return Values:arrow-up-right

Name
Type
Description

surplusBeneficiary

address

The address of SurplusBeneficiary

BorrowerChangedarrow-up-right

(Deprecated function, will be removed in the next release), In the previous version Vault used to "borrow" from IF by calling IF.borrow(). We have since removed the behavior but kept the variable name "borrower" for backward-compatibility

Parameters:arrow-up-right

Name
Type
Description

borrower

address

The address of the borrower (actually is Vault address)

VaultChangedarrow-up-right

Parameters:arrow-up-right

Name
Type
Description

vault

address

The address of the vault

Parameters:arrow-up-right

Name
Type
Description

repaidAmount

uint256

Repaid amount of the token

tokenBalanceAfterRepaid

uint256

InsuranceFund's token balance after repay

DistributionThresholdChangedarrow-up-right

We will transfer fee to SurplusBeneficiary if InsuranceFund free collateral is over distribution threshold

Parameters:arrow-up-right

Name
Type
Description

distributionThreshold

uint256

Distribution threshold amount

SurplusBeneficiaryChangedarrow-up-right

Parameters:arrow-up-right

Name
Type
Description

surplusBeneficiary

address

The address of SurplusBeneficiary

FeeDistributedarrow-up-right

Parameters:arrow-up-right

Name
Type
Description

surplus

uint256

The amount of distribution

insuranceFundCapacity

uint256

The capacity of insuranceFund contract

insuranceFundFreeCollateral

uint256

The free collateral(usdc) of insuranceFund contract in vault

distributionThreshold

uint256

The distribution threshold amount

Last updated