> For the complete documentation index, see [llms.txt](https://docs.mstable.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mstable.org/docs/architecture-and-smart-contracts.md).

# Architecture & Smart Contracts

How the **Stacked Yield** vault is structured onchain and the role of automation.

#### Smart contract base

* Built on Chamber, the asset-management infrastructure powering mStable. Chamber provides non-custodial vault logic, ERC20 token issuance, and the guardrails that integrations plug into.
* Chamber is a battle-tested set of contracts also used by Toros Finance and other Chamber vaults. Chamber was previously known as dHEDGE.
* Stacked Yield is a single Chamber vault, with **mPT-sUSDe** as its ERC20 share token.

#### Automation and bots

* **Rebalance bots:** adjust positions to maintain safe health factors.
* **Capacity bots:** secure Aave borrow slots when caps reset, ensuring the vault retains access.
* Position rollovers (for example into the next Pendle PT series) are handled by mStable as part of active vault management, not by a dedicated bot.
* All actions are non-custodial. Bots execute predefined strategies and do not hold user funds.

#### Permissions and safety

* **Pause functions:** emergency shutdown tools to halt deposits or rollovers if needed.
* **Risk limits:** leverage and health-factor thresholds enforced by the rebalance bots.

#### Contract addresses (Ethereum Mainnet)

[*mPT-sUSDe*](https://etherscan.io/token/0xfec2adfa296fe189f53089fd5ccd8c28dd559cf2)


---

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

```
GET https://docs.mstable.org/docs/architecture-and-smart-contracts.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.
