> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fx.meme/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocol architecture

> The contracts behind a launch, a trade, and the protocol's revenue commitment.

FX builds its token markets on native Uniswap v4 pools. PoolManager holds the pool state and executes swaps; FX's contracts define launches, collect hook fees, account for rewards, and manage protocol revenue.

This page describes the R6 contracts deployed on Arc mainnet. See [deployed contracts](/developers/contracts) for addresses and the release manifest.

## The market path

```mermaid theme={null}
flowchart TB
    CR["Creator"] --> F["FX factory"]
    R["Approved currency-pool registry"] --> F
    F --> T["Fixed-supply token"]
    F --> P["Locked canonical positions"]
    P --> M["Uniswap v4 PoolManager"]
    U["Trader"] --> Q["Quote and route"]
    Q --> M
    M --- H["FX hook"]
    H --> C["Creator and holder accounting"]
    H --> V["Protocol revenue collection"]
```

An FX-pair launch creates two token pools. Its external currency pool is already registered. A single-currency launch creates one token pool.

## Contract responsibilities

| Component                    | Responsibility                                                                                       |
| ---------------------------- | ---------------------------------------------------------------------------------------------------- |
| `FXMemeFactoryV6`            | Validates launch settings, creates token markets, charges the creation fee, and activates the launch |
| `FXMemePoolRegistry`         | Admits approved currency pools and provides pool-derived currency pricing                            |
| `FXMemeHookV6`               | Enforces registered-pool fee accounting and the opening surcharge                                    |
| `FXMemeRouterV6` and quoters | Quote and execute bounded direct or multihop routes                                                  |
| `FXMemePositions`            | Holds permanently locked canonical LP positions and compounds their earnings                         |
| `FXMemeRewards`              | Tracks backed holder entitlements separately from protocol revenue                                   |
| `FXMemeVesting`              | Releases vested builder tokens to the fixed beneficiary                                              |
| `FXMemeRevenueCollector`     | Collects protocol claims, buffers foreign assets, and forwards realized USDC                         |
| `FXMemeConversionRegistry`   | Admits constrained direct asset/USDC conversion routes                                               |
| `ProtocolRevenueVault`       | Applies the 90/10 split and enforces the reserved buyback commitment                                 |

## Quotes and settlement

A quote describes a specific route, input or output amount, and its per-leg deductions. The router checks the actual settlement against the trader's bounds and deadline.

The hook charges fees on registered pools regardless of which compatible router submits the swap. Routing through a different entry point does not exempt that pool from its hook fees.

Raw token units and integer rounding are authoritative. Integrations must use each asset's actual decimal precision.

## Currency pricing and admission

R6 admits initialized, hookless, static-fee Uniswap v4 pools on the approved PoolManager. Admission checks currency identity, metadata, ordering, active liquidity, and quotes in both directions.

FX-pair starting prices come from the approved pool's current price. Revenue normalization uses an admitted direct asset/USDC pool.

R6 does not depend on an external price oracle or an API key for these paths. Pool-derived marks describe onchain market prices; they do not independently verify a fiat exchange rate.

## Revenue is buffered before conversion

Protocol hook claims are attributed to the revenue collector. USDC can be forwarded directly to the vault. Other assets remain in their own inventories until a constrained conversion settles.

Conversion checks include route limits, available liquidity, quote acceptance, full fill, impact bounds, and exact settlement. The vault credits actual received USDC.

A trade never needs to perform a protocol buyback synchronously to complete.

## Authority and immutable commitments

The deployed release uses direct owner authority with **no governance timelock**. The owner address is recorded in the [release manifest](/developers/contracts#release-manifest).

| Action                                                                                   | Authority                                |
| ---------------------------------------------------------------------------------------- | ---------------------------------------- |
| Open new launches                                                                        | Registry owner                           |
| Pause new launches                                                                       | Registry owner or guardian               |
| Admit or replace a valid currency-conversion route                                       | Owner, within immutable validation rules |
| Pause or resume optional conversion and buyback execution                                | Owner                                    |
| Change the operations receiver                                                           | Owner                                    |
| Collect protocol fees, convert within limits, checkpoint, or execute an eligible buyback | Permissionless                           |
| Replace registered official \$FX or its canonical buyback market                         | Unavailable                              |
| Change the 90/10 split or redirect acquired buyback tokens                               | Unavailable                              |
| Withdraw reserved buyback funds to another destination                                   | Unavailable                              |

Owner choices can affect liveness and venue selection. Immutable custody rules constrain destinations; they do not guarantee favorable execution prices.

## Deployment identity

Integrations must bind to a verified release's network, factory, registries, PoolManager, hook, and revenue contracts. A contract name, token ticker, or sample address is not a deployment identity.

Use the [mainnet addresses and manifest](/developers/contracts). The [release status page](/reference/release-status) tracks contract deployment, the launch gate, official FX registration, and app availability.

<CardGroup cols={2}>
  <Card title="Quote and settle" icon="route" href="/developers/quote-and-settle">
    Read the order structure, detailed fees, and settlement checks.
  </Card>

  <Card title="Market data" icon="database" href="/developers/market-data">
    Integrate bounded pages and consistent snapshots.
  </Card>
</CardGroup>
