IInsuranceFund
Functions
repay
If insurance has negative accountValue of vault, will deposit amount to vault
distributeFee
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:
Name | Type | Description |
---|---|---|
| uint256 | The surplus of distribution |
getToken
Get settlement token address
Return Values:
Name | Type | Description |
---|---|---|
| address | The address of settlement token |
getBorrower
(Deprecated function, will be removed in the next release), Get borrower(Vault
) address
Return Values:
Name | Type | Description |
---|---|---|
| address | The address of |
getVault
Get Vault
address
Return Values:
Name | Type | Description |
---|---|---|
| address | The address of |
getInsuranceFundCapacity
Get InsuranceFund
capacity
Return Values:
Name | Type | Description |
---|---|---|
| int256 | The capacity value (settlementTokenValue + walletBalance) in settlement token's decimals |
getDistributionThreshold
Get insurance distributution threshold, this value is for fee distribution
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The distribution threshold number |
getSurplusBeneficiary
Get SurplusBeneficiary
Return Values:
Name | Type | Description |
---|---|---|
| address | The address of |
Events
BorrowerChanged
(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:
Name | Type | Description |
---|---|---|
| address | The address of the borrower (actually is |
VaultChanged
Parameters:
Name | Type | Description |
---|---|---|
| address | The address of the vault |
Repaid
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | Repaid amount of the token |
| uint256 | InsuranceFund's token balance after repay |
DistributionThresholdChanged
We will transfer fee to SurplusBeneficiary
if InsuranceFund
free collateral is over distribution threshold
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | Distribution threshold amount |
SurplusBeneficiaryChanged
Parameters:
Name | Type | Description |
---|---|---|
| address | The address of |
FeeDistributed
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The amount of distribution |
| uint256 | The capacity of |
| uint256 | The free collateral(usdc) of |
| uint256 | The distribution threshold amount |
Last updated