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

# BaiBai

> L2 swap DEX and aggregator

## BaiBai

**[BaiBai](https://www.baibai.cx/)** is an L2 swap DEX and aggregator. It combines BaiBai Prop AMM liquidity with other liquidity sources to give users the best available swap price. You can also find the dedicated BaiBai docs at [docs.baibai.cx](https://docs.baibai.cx).

## What It Does

Say baibai to poor prices. BaiBai is a next-generation Prop AMM built to trade at the best price, every time.

* **Best price, verified.** BaiBai’s Prop AMM is designed to provide the best price and is fully composable with other liquidity sources for optimal execution.
* **Tightest spreads, engineered.** BaiBai updates price curves in real time, adjusts depth dynamically, and quotes at high frequency.
* **Friction removed.** BaiBai runs on a custom appchain that is composable with Base and Ethereum for seamless L2 token trading.
* **No gas required.** Users sign gasless EIP-712 orders; trades settle without the user paying network gas.

BaiBai can route trades across multiple liquidity sources, including BaiBai Prop AMM, so users get the best available price. To integrate, start with the [Aggregator Flow](/baibai/aggregator-flow) or jump into the [API Reference](/baibai/api-reference).

<Info>
  The integration API currently supports **gasless EIP-712 orders only**. Traditional/non-gasless orders are coming soon.
</Info>

## Architecture

BaiBai is powered by [Pylon](/pylon). The appchain handles custom execution and real-time market-maker updates, while users and integrators interact with normal L2 token balances.

Integrators do not need to bridge or call the appchain directly. Use the BaiBai API.

## Native ETH

Gasless orders use ERC-20 token transfers through Permit2. Native ETH is not a gasless order token.

* Swapping from ETH: request an indicative quote with WETH as the sell token, then wrap ETH to WETH before signing/submitting.
* Swapping to ETH: quote and buy WETH, then unwrap WETH after the order fills.
* The caller is responsible for wrap and unwrap transactions.
* If wrap, approval, or user signing takes time, request a fresh quote before submitting.

Base WETH: `0x4200000000000000000000000000000000000006`

## Start Here

<Columns cols={3}>
  <Card title="Aggregator Flow" icon="route" href="/baibai/aggregator-flow">
    Understand quote, sign, submit, and poll.
  </Card>

  <Card title="API Reference" icon="code" href="/baibai/api-reference">
    See endpoints, fields, errors, and OpenAPI.
  </Card>

  <Card title="Wallet Integration" icon="wallet" href="/baibai/wallet-integration">
    Build wallet flows with Permit2, signing, and polling.
  </Card>
</Columns>

## Links

* [BaiBai](https://baibai.cx)
