> For the complete documentation index, see [llms.txt](https://y2k-finance.gitbook.io/y2k-finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://y2k-finance.gitbook.io/y2k-finance/products/earthquake-builder-program/guides.md).

# Guides

## Deployment of SIV

[Foundry Script](https://github.com/Y2K-Finance/SelfInsuredVault/blob/master/script/DeployScript.s.sol)

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

[Foundry Script](https://github.com/Y2K-Finance/SelfInsuredVault/blob/1fccdb77ea5c2e1c070a2372cf74f73feb15b046/script/Configure.s.sol#LL9C10-L9C20)

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 [here](/y2k-finance/products/earthquake-builder-program/builder-info/technical-overview-of-the-insuranceprovider-contract.md#insurance-provider).

```
    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();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://y2k-finance.gitbook.io/y2k-finance/products/earthquake-builder-program/guides.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
