Perp v2
Perp v2
  • About Perpetual Protocol
    • Social Links
    • Governance
    • v2 Era Ecosystem
    • PERP Token
  • Terms of Service
  • General
    • Wallets
    • Transfering Assets
    • Deposit & Withdrawal
    • Perpetual + Uniswap
    • FAQs
    • Guides
    • Legacy Reward Programs
    • Security
  • Hot Tub
  • Trading on Perp v2
    • How It Works
    • UI Overview
    • Perpetual Futures Basics
    • Trading Quick-start
    • Opening and Closing Positions
    • Account Value & More
    • Funding Payments
    • Order Types
    • Trading Fees and Gas Fees
    • Managing Risk
    • Multi-collateral
    • More docs
  • Providing Liquidity
    • Basics
    • Introduction to Maker UI
    • Add / Remove Liquidity
    • Estimated Fees and Rewards APR
    • More on LPing
    • Tools for LPs
  • Perp v2 Specs
  • Developer Docs
    • Developer FAQs
    • Source Code
    • Protocol Attributes
    • Contract guide
      • AccountBalance
      • BaseToken
      • ClearingHouse
      • CollateralManager
      • DelegateApproval
      • Exchange
      • InsuranceFund
      • MarketRegistry
      • OrderBook
      • QuoteToken
      • Vault
      • VirtualToken
    • Interface Contracts
      • IAccountBalance
      • IBaseToken
      • IClearingHouse
      • IClearingHouseConfig
      • IClearingHouseConfigEvent
      • ICollateralManager
      • IDelegateApproval
      • IERC20Metadata
      • IExchange
      • IIndexPrice
      • IInsuranceFund
      • IMarketRegistry
      • IOrderBook
      • IVault
      • IVirtualToken
    • Integration guide
    • Dev tools
Powered by GitBook
On this page

Was this helpful?

  1. Developer Docs
  2. Contract guide

InsuranceFund

Last updated 1 year ago

Was this helpful?

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

  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

Name
Type
Description

surplus

uint256

The surplus of distribution

  function getToken(
  ) external returns (address)

Get settlement token address

Name
Type
Description

token

address

The address of settlement token

  function getBorrower(
  ) external returns (address)

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

Name
Type
Description

vault

address

The address of Vault

  function getVault(
  ) external returns (address)

Get Vault address

Name
Type
Description

vault

address

The address of Vault

  function getDistributionThreshold(
  ) external returns (uint256)

Get insurance distributution threshold, this value is for fee distribution

Name
Type
Description

distributionThreshold

uint256

The distribution threshold number

  function getSurplusBeneficiary(
  ) external returns (address)

Get SurplusBeneficiary

Name
Type
Description

surplusBeneficiary

address

The address of SurplusBeneficiary

  function getInsuranceFundCapacity(
  ) public returns (int256)

Get InsuranceFund capacity

Name
Type
Description

capacityX10_S

int256

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

distributeFee

Return Values:

getToken

Return Values:

getBorrower

Return Values:

getVault

Return Values:

getDistributionThreshold

Return Values:

getSurplusBeneficiary

Return Values:

getInsuranceFundCapacity

Return Values:

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​