Y2K Finance
  • 🎬Overview
  • Products
    • πŸ’₯Earthquake
      • Mechanics
      • Determining Strike Prices
      • Hedge Pricing
      • Contracts
        • Developer Info
        • Addresses
        • Subgraph
    • Developer Info
    • πŸ‘·β€β™‚οΈEarthquake Builder program
      • πŸ‘©β€πŸ’»Builder Info
        • Technical Overview Self-Insured Vault (SIV) Contract
        • Technical Overview of the Yield Source Contract
        • Technical Overview of the InsuranceProvider Contract
      • πŸ“šGuides
        • YieldSource examples
    • πŸ”₯Wildfire
    • πŸ—ΊοΈRoadmap
  • Tokenomics
    • πŸ™‚Y2K
    • πŸ”“vlY2K
    • πŸ’£Vault Tokens
    • πŸͺ™Tokenomics/Distribution
  • HOW-TO GUIDES
    • 🏎️Turbo Options
    • 🧠Vault Strategies
      • ❓FAQ's
      • πŸ—ΊοΈHow To Use
      • πŸ—οΈUI Breakdown
    • πŸ’°Claiming Rewards
    • πŸ’₯V2 User Guide
    • 🧯Y2K App - UI V2
      • πŸ’ΉMarkets Page
      • πŸ†ŽMarket Type Page
      • πŸ“ΌAsset Page
      • 🧚Quick Mint
      • πŸ…My Portfolio
  • Learn More
    • πŸ”Audits
    • πŸ“©Borrowing & Lending Using $Y2K
    • πŸ’±Change log
    • πŸ”΄Disclaimers
    • ⬆️Earthquake V2 FAQ
    • πŸ‘Useful Links
Powered by GitBook
On this page
  • Deployment of SIV
  • Add markets to SIV
  • Purchase Insurance
  1. Products
  2. Earthquake Builder program

Guides

PreviousTechnical Overview of the InsuranceProvider ContractNextYieldSource examples

Last updated 1 year ago

Deployment of SIV

SIV constructor requires three addresses as input parameters: paymentToken, yieldSource, and emissionsToken. It's important to note that for Carousel, emissionsToken represents the Y2K token, while for V2 or V1, it should be address(0).

    SelfInsuredVault siv = new SelfInsuredVault(
        paymentToken,
        yieldSource,
        emissionsToken
    );

Once you have deployed SIV, it is crucial to remember to transfer the ownership of the yieldSource to SIV.

    IYieldSource(yieldSource).transferOwnership(address(siv));

Add markets to SIV

The market information consists of several key parameters: insuranceProvider, marketId, premiumWeight, and collateralWeight. For a detailed explanation of these parameters, please refer to the technical overview. Insurance Provider addresses can be found .

    SelfInsuredVault(siv).addMarket(
        market.insuranceProvider,
        market.marketId,
        market.premiumWeight,
        market.collateralWeight
    );

Market weights can be updated with market index.

    SelfInsuredVault(siv).setWeight(
        index,
        newPremiumWeight,
        newCollateralWeight
    );

Purchase Insurance

The purchaseInsuranceForNextEpoch function in SIV is designed to deposit funds into Earthquake. Notably, this function does not require any parameters to be provided.

    SelfInsuredVault(siv).purchaseInsuranceForNextEpoch();

πŸ‘·β€β™‚οΈ
πŸ“š
Foundry Script
Foundry Script
here