> For the complete documentation index, see [llms.txt](https://docs.oh.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oh.finance/protocol/oh-yield-index/oh-bank.md).

# Oh! Bank

The `OhBank` is the main protocol yield-generating contract. Each Bank manages a set of Strategies that interact with individual DeFi protocols, creating a DeFi Yield Index.

Each Bank is an ERC-20 token, which represents the holder's percentage ownership of all underlying tokens controlled by the Bank and it's Strategies. Users deposit an`underlying` token (i.e. USDC) to the Bank to receive Bank shares (i.e. Oh! USDC) that automatically accrue interest.

The exchange rate of underlying tokens to Bank shares is given by the following formula:

```
share_price = (total_underlying_deposited + total_yield_generated) / total_shares
```

Users can call the following functions to interact with each Bank:

* `deposit()` - Deposit a given amount of underlying tokens to receive equivalent Bank shares
* `depositFor()` - Deposit a given amount of underlying tokens from the caller for a given recipient
* `depositWithPermit()` - Deposit a given amount of underlying tokens from the caller for a given recipient for EIP-2612 Compliant tokens (tokens that support the `permit()` function)
* `withdraw()` - Withdraw a given amount of Bank shares to receive equivalent underlying tokens

The Bank supports calling the `permit()` function (EIP-2612 Compliant) and upgradeability via standardized proxy storage (EIP-1967 Compliant).

{% hint style="info" %}
Only EOAs (Externally Owned Addresses, i.e. end-users) and whitelisted Smart Contracts can call Bank functions to prevent attacks.
{% endhint %}


---

# 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://docs.oh.finance/protocol/oh-yield-index/oh-bank.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.
