> For the complete documentation index, see [llms.txt](https://docs.tapir.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tapir.money/resources/source-code-and-contracts.md).

# Source Code & Contracts

Public Core V1 and DP/YB markets repositories, technical documentation, deployments, and audit verification.

Tapir’s contracts are maintained in **two public repositories**. Core V1 creates DP and YB and settles their claims; the markets repository provides the AMM where those tokens trade.

| Repository                                                                                 | What it contains                                                                                                                                                    |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Tapir Core V1**](https://github.com/tapir-protocol/public-tapir-core-v1)                | Depeg pools, the core factory, DP/YB tokens, the Tapir router, oracle modules, specifications, and audit verification.                                              |
| [**Tapir Markets / AMM V1**](https://github.com/tapir-protocol/public-tmarket-univ3-based) | Tapir’s Uniswap V3 fork for DP/YB trading: the AMM factory, pool deployer, concentrated-liquidity pools, dynamic swap fees, pause controls, and audit verification. |

Both repositories include documentation and security-reporting instructions. Published audit reports and their scope are collected on [Security & Audits](https://docs.tapir.money/security/security-and-audits.md).

Core behavior in these docs was checked against revision [`25d1ba8`](https://github.com/tapir-protocol/public-tapir-core-v1/tree/25d1ba8a06be496c77f79529b266f38c6ef6176b); the markets references were checked against [`0367903`](https://github.com/tapir-protocol/public-tmarket-univ3-based/tree/03679034d8ec29f82672d97d3ac93c0105a109eb), on **2026-09-08**. Contract behavior takes precedence over explanatory comments; the core README identifies stale comments in the frozen audited source.

## Technical reference

| Resource                                                                                                                                        | What it explains                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [Core repository overview](https://github.com/tapir-protocol/public-tapir-core-v1#readme)                                                       | Contract roles, builds, deployment discovery, audit scope, and licensing.                                               |
| [Core contracts](https://github.com/tapir-protocol/public-tapir-core-v1/tree/main/contracts)                                                    | Pool, factory, DP/YB tokens, router, and price/VRP/PTRW oracles.                                                        |
| [Pool lifecycle and risk controls](https://github.com/tapir-protocol/public-tapir-core-v1/blob/main/docs/tapir_pool_lifecycle_risk_controls.md) | State transitions, price aging, pauses, oracle replacement, and treasury rescue.                                        |
| [Access control](https://github.com/tapir-protocol/public-tapir-core-v1/blob/main/docs/tapir_access_control.md)                                 | Admin, operator, owner, and permissionless capabilities.                                                                |
| [Oracle specifications](https://github.com/tapir-protocol/public-tapir-core-v1/tree/main/docs)                                                  | Price aggregation, high watermarks, vault previews, and PT redemption witnesses.                                        |
| [Generated technical specifications](https://github.com/tapir-protocol/public-tapir-core-v1/tree/main/docs/generated)                           | Function-level integration reference.                                                                                   |
| [Core audit verification](https://github.com/tapir-protocol/public-tapir-core-v1/blob/main/VERIFICATION.md)                                     | Reconstructing audited commit hashes and checking source identity.                                                      |
| [Markets repository overview](https://github.com/tapir-protocol/public-tmarket-univ3-based#readme)                                              | AMM architecture, builds, deployments, and differences from Uniswap V3.                                                 |
| [Markets contracts](https://github.com/tapir-protocol/public-tmarket-univ3-based/tree/main/contracts)                                           | AMM factory, pool deployer, pool implementation, interfaces, and libraries.                                             |
| [AMM specification and integration notes](https://github.com/tapir-protocol/public-tmarket-univ3-based/blob/main/docs/TapirUniswapV3.md)        | Dynamic fees, swap pausing, administrator permissions, and integration behavior.                                        |
| [Markets audit verification](https://github.com/tapir-protocol/public-tmarket-univ3-based/blob/main/VERIFICATION.md)                            | Reproducing the connection to Quantstamp’s audited AMM commit `ff4d820`, including the documented comment-only changes. |
| [Markets audit scope](https://github.com/tapir-protocol/public-tmarket-univ3-based/blob/main/docs/audits/README.md)                             | Tapir AMM review scope and inherited Uniswap audit materials.                                                           |

The AMM’s `tapirAdmin` can change swap fees and pause swaps, while liquidity minting, burning, and collection remain available. Integrators should read `dynamicFee()` for the current swap cost; the immutable `fee()` identifies the pool and its tick spacing. Pool-native `flash()` is removed in this fork. See the AMM integration notes above for details.

## Base protocol deployments

The core and markets repositories document these protocol-level contracts on **Base mainnet (chain ID 8453)**:

| Contract                 | Address                                                                                                                      |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| Core DepegFactory        | [`0xc0C409aEdCE4fE91Fa26971EdF23E7d97C81d1c5`](https://basescan.org/address/0xc0C409aEdCE4fE91Fa26971EdF23E7d97C81d1c5#code) |
| Core TapirRouter         | [`0xe549F51772E4C889a4F68144405163c81EE69e09`](https://basescan.org/address/0xe549F51772E4C889a4F68144405163c81EE69e09#code) |
| Markets UniswapV3Factory | [`0xa6FCDCd4A53072e8A5A73344fdB2ddFCDd78F94B`](https://basescan.org/address/0xa6FCDCd4A53072e8A5A73344fdB2ddFCDd78F94B#code) |

Each market has its own pool, DP/YB tokens, oracle, parameters, and authorized routers. Earlier deployments may use different shared infrastructure. Do not substitute a newer router into an older market without checking that pool's `isAuthorisedRouter(address)` getter.

Discover pools through the factory's `getDepegModule(uint256)` registry, starting at index zero and incrementing until the call reverts. Each entry returns `(dpAsset, ybAsset, depegPool)`. Read the pool's `ASSET()`, `oracle()`, `MIN_PRICE()`, `MAX_PRICE()`, and `getState()` getters to inspect its configuration. A registry entry alone does not identify a funded product offering. The designated launch pool is [Zircuit USDC Vault](https://docs.tapir.money/live-markets/live-markets/zircuit-usdc-90d-base.md), at registry index 2. Its planned public opening is September 22, 2026, subject to launch readiness.

The repository README gives commands for comparing the factory and router runtime bytecode with compiled artifacts. Pool and oracle instances include market-specific immutable values, so verifying them requires accounting for those values. [Live Markets](https://docs.tapir.money/live-markets/live-markets.md) provides market-level context.

## Reading these docs with an LLM

GitBook publishes an [LLM documentation index](https://docs.tapir.money/llms.txt) and a [full Markdown export](https://docs.tapir.money/llms-full.txt). Individual pages also have Markdown versions; follow the URLs in the index so GitBook's published page paths are preserved.

The docs repository includes a curated `llms.txt` for repository readers. GitBook generates the live site's index from published content, so the live index also reflects new and renamed pages. This behavior is described in [GitBook's LLM-ready docs guide](https://gitbook.com/docs/getting-started/llm-ready-docs).

When checking a claim, use the relevant contract and audit version for protocol behavior, current on-chain reads for mutable settings, and the dated research snapshot for underlying-vault analysis. Tokenomics proposals and points programs do not establish deployed contract functionality or guaranteed rewards.
