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

# Smart Contract Architecture

Axiom is composed of several smart contracts, each with a clear and isolated role. This modular design makes the system more secure, more upgradeable, and easier to reason about.

***

#### **Vaults (XRPVault and future stablecoin vaults)**

Responsible for:

* Accepting deposits
* Minting non-transferable share tokens (aXRP)
* Burning shares on withdrawal
* Increasing share price as yield accrues
* Enforcing resolution locks

The vaults follow a modified ERC-4626 pattern for predictable, fair accounting.

***

#### **Eligibility Registry**

Responsible for:

* Snapshotting staker USD values
* Sorting stakers by percentile
* Defining the top 50 percent
* Providing Merkle proofs for eligibility
* Supporting fraud proofs during decentralized operation

The system uses an optimistic off-chain Merkle snapshot model with on-chain verification if challenged.

***

#### **MarketFactory**

Responsible for:

* Creating new markets
* Verifying top 50 percent eligibility post-bootstrap
* Deploying market implementations
* Managing implementation registration over time

The MarketFactory is upgradeable so the protocol can keep evolving while preserving a stable creation interface.

***

#### **AxiomConditionalTokens**

Responsible for:

* Representing outcome positions as ERC-1155 tokens
* Splitting collateral into complete sets
* Merging complete sets back into collateral
* Redeeming resolved winning positions

This is the core positions primitive behind Axiom’s CLOB markets.

***

#### **AxiomCTFMarket**

Responsible for:

* Preparing each market condition
* Storing market-level metadata and configuration
* Acting as the oracle for resolution
* Reporting payouts to Conditional Tokens
* Exposing market-scoped redemption helpers

This contract connects the prediction market question to the tokenized outcome positions.

***

#### **AxiomCTFExchange**

Responsible for:

* Verifying signed orders
* Tracking partial fills and cancellations
* Settling matched trades atomically onchain
* Moving collateral and ERC-1155 outcome tokens safely
* Charging CLOB protocol fees during settlement

This is the onchain settlement engine for Axiom’s order-book trading.

***

#### **FeeRouter and Rewards Infrastructure**

Responsible for:

* Routing staker fees to the correct recipient
* Funding rewards and vault yield flows
* Supporting bootstrap incentives and post-bootstrap yield distribution

The fee path differs between bootstrap and post-bootstrap states, but the design goal stays the same: market activity should fund protocol incentives and staker yield.


---

# 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.axiomprotocol.io/whitepaper/architecture-overview/smart-contract-architecture.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.
