# 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="https://3215725803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoDBCiBkZgiUh0HLuvU5L%2Fuploads%2FR1KyEWRgN01AaxmJV03Y%2Fimage.png?alt=media&#x26;token=91cc434e-b2d1-490e-aca1-c81ffd705a92" alt=""><figcaption></figcaption></figure>

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

* [The Peg Stability Module](https://docs.maha.xyz/stablecoin-zai/peg-mechanics/peg-stablility-module-psm): 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](https://docs.maha.xyz/stablecoin-zai/peg-mechanics/direct-deposit-module-ddm): 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](https://docs.maha.xyz/stablecoin-zai/peg-mechanics/peg-stablility-module-psm) 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](https://docs.maha.xyz/stablecoin-zai/peg-mechanics/direct-deposit-module-ddm), 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](https://docs.maha.xyz/security/risks) to understand more deeply about situations when this is not the case.


---

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