# Smart Contract Architecture

The protocol is built using a modular and extensible architecture, allowing for easy implementation of new strategies. Vault contracts are separated from the Strategy contracts. Vaults manage the funding part - deposits, withdrawals etc. While the strategy contracts abstract the trading strategy part. A  vault could implement multiple strategies. This is a design that is also used by Yearn Finance.

<br>

![](https://lh6.googleusercontent.com/rbK8pfHKu1KKDUGJMku_24qfjr_CByVOfYOLoSivkk8xTjOdWfX8HRSV8f4VW1wSKstA95sCpLUqxgNz0HQyL15Nt-6-JOhfgyEz8cvGkDXwQAOr-eP3-h81sXuZEpH7mmWEI8uddZvW1hxaAxFrh0Y)

* BaseVault - base vault contract managing deposits and withdrawals
* OptionsVault - a generic contract for options based vaults
* VaultRegistry - registry managing vaults lifecycle
* Strategy - implements a trading strategy. a vault can have one or many strategies
* VerticallCallSpreadStrategy - a specific strategy
* OptionPriceOracle - base interface for option pricing data

\
Vault contracts are upgradable, using the upgradable proxy pattern: <https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable> . This is to avoid the need to migrate clients and their funds to new vaults if a change is needed. Every contract upgrade is controlled by the UpYield Finance DAO and its representatives.


---

# Agent Instructions: 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:

```
GET https://yield-finance.gitbook.io/yield-finance-docs/the-protocol/smart-contract-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
