> For the complete documentation index, see [llms.txt](https://docs.maha.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maha.xyz/stablecoin-zai/peg-mechanics.md).

# Peg Mechanics

The pegging mechanism of ZAI ($ZAI) ensures that it maintains a 1:1 ratio with the US Dollar. This is achieved through a combination of collateralization, algorithmic adjustments, and market incentives.

<figure><img src="/files/kpmz8rdPSDoFXGyeCmh7" alt=""><figcaption></figcaption></figure>

There are two core modules that allow for ZAI to achieve stability and scale.

* [The Peg Stability Module](/stablecoin-zai/peg-mechanics/peg-stablility-module-psm.md): Focused on stability, the ZAI PSM allows users to mint/redeem ZAI for stablecoins at a 1:1 ratio. This ensures stability for ZAI at the 1$ price mark.
* [The Direct Deposit Module](/stablecoin-zai/peg-mechanics/direct-deposit-module-ddm.md): Focused on growth, the ZAI DD module allows the protocol to mint large amounts of ZAI into lending protocols that allow borrowers to take over-collateralized loans in ZAI, generating interest for users.

***

## Peg Mechanics

At no point in time does ZAI become under-collateralized. It is either backed by stablecoins via the Peg Stability Module (PSM) or it is backed by over-collateralized loans via the Direct Deposit Module (DDM).

* **When ZAI is trading above $1,** arbitrageurs can simply mint more ZAI by depositing USDC (or other stablecoins) onto the [PSM](/stablecoin-zai/peg-mechanics/peg-stablility-module-psm.md) module and sell the newly minted ZAI into the open market bringing the peg back to $1. At the same time the protocol can also issue more debt (priced at $1) to encourage users to borrow ZAI and sell it in the open market.
* **When ZAI is trading below $1**, arbitrageurs can simply buy back the ZAI from the open market and redeem USDC (or other stablecoins) from the PSM, bringing the peg back to $1. If the PSM does not have enough liquidity to maintain the peg, then the protocol can recall the loans issued by the [Direct Deposit Module](/stablecoin-zai/peg-mechanics/direct-deposit-module-ddm.md), forcing borrowers to repay their loans in ZAI.

Because in both mechanisms, ZAI is either minted using the PSM or lent using the DDM, and the positions are always over-collateralized, ZAI will be able to maintain its peg at $1.

Please read the [risks section](/security/risks.md) to understand more deeply about situations when this is not the case.


---

# 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.maha.xyz/stablecoin-zai/peg-mechanics.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.
