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

# FXD Stablecoin

Introduction to Fathom's FXD Stablecoin

**Overview of Fathom's FXD Stablecoin Smart Contracts**

The Fathom stablecoin smart contracts form the technical backbone of the Fathom stablecoin (FXD), a crucial component of the Fathom Protocol. These contracts are engineered to provide a secure, efficient, and transparent mechanism for stablecoin operations, aligning with the broader goals of the Fathom Protocol to enhance liquidity and stability within the DeFi ecosystem.

**Key Technical Aspects**

1. **Smart Contract Architecture**: The Fathom stablecoin smart contracts are built on a modular architecture, ensuring scalability, upgradability, and maintainability. This architecture comprises several interlinked contracts, each handling specific aspects of the stablecoin's lifecycle, including minting, burning, and transaction processing.
2. **Minting and Burning Mechanisms with LTV Ratio**: At the heart of the smart contracts are the mechanisms for minting and burning FXD. Minting occurs when users collateralize their position, with the amount of FXD minted governed by the Loan-to-Value (LTV) ratio. This ensures a balanced issuance of FXD, aligning with the value of the collateral. Conversely, burning happens when FXD is returned to the protocol, particularly during position closures or liquidation events, to maintain the supply in line with market dynamics and collateral value.
3. **Soft-Pegging to the US Dollar**: The smart contracts implement a soft-pegging mechanism that ties the value of FXD to the US dollar. This is achieved through the StableSwapModule, which creates arbitrage opportunities that incentivize price pegging towards $1. As a result, the stablecoin’s value remains consistently close to the pegged asset.
4. **Advanced Fixed-Spread Liquidation (AFSL):** A liquidator can repay a fraction of the borrower's debt and acquire its collateral at a discount. Additionally, to the basic model of AFSL, FXD implements batch liquidation processing as part of the migration to [Dynamic Spread Tiered Liquidation (DSTL)](https://medium.com/@anton.grigorev.dev/advancing-liquidation-mechanisms-the-journey-to-dynamic-spread-tiered-liquidation-dstl-in-fathom-d35f14074ef3).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fathom.fi/fxd-stablecoin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
