> For the complete documentation index, see [llms.txt](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/reference/routes.md).

# Routes

File-based routing under `src/routes`. `src/routeTree.gen.ts` is generated — never edit it.

| File            | URL          | Purpose                                                           |
| --------------- | ------------ | ----------------------------------------------------------------- |
| `__root.tsx`    | —            | Shell: providers, head metadata, fonts, favicon, `Toaster`        |
| `index.tsx`     | `/`          | Landing: hero film, boot sequence, status strip, editorial panels |
| `terminal.tsx`  | `/terminal`  | Execution terminal: quote, score, approve, swap                   |
| `markets.tsx`   | `/markets`   | Searchable registry with live quotes, refreshed every 20s         |
| `portfolio.tsx` | `/portfolio` | On-chain holdings, valuation and concentration metrics            |
| `alerts.tsx`    | `/alerts`    | Alerts — awaiting auth UI                                         |
| `settings.tsx`  | `/settings`  | Settings — awaiting auth UI                                       |
| `about.tsx`     | `/about`     | Methodology, sources, contracts, disclosures                      |

## Landing (`/`)

Sections, in order: hero film with sound toggle → live status strip → "Reality, quoted." → "How it works" (Scan / Stress / Trade) → "The Reality Score" → live market preview → risk and jurisdiction disclosures → independence notice.

The status strip renders unknown or degraded per cell unless that specific request succeeded. Every cell is independent; one upstream failure does not blank the strip.

## Terminal (`/terminal`)

Controls: side (buy/sell), asset, amount. The panel shows buy amount, minimum received, network fee, route sources, all returned fees, quote age, spread, effective cost in bps, multiplier, pending corporate action, halt state, market session, and the full score breakdown.

The [eligibility gate](/bubblegum-reality-docs/compliance/eligibility.md) blocks trade actions and is enforced again server-side on every firm quote.

## Markets (`/markets`)

The full canonical registry with search, market-session badge, live multiplier-adjusted bid/ask, spread, a condition chip derived from spread quality, and per-row explorer and trade links. Reference prices come from one batched `getPrices` call on a 20s refresh — never one 0x request per row, which would rate-limit the key and produce a wall of failures.

## Portfolio (`/portfolio`)

Real balances via batched Multicall3 reads, valued against multiplier-adjusted references, plus total value, top weight, top-3 weight, HHI, effective positions and a risk band. Halted or unpriced holdings are listed but excluded from weights.

## Terminal AI panel

The terminal mounts the Reality Check panel below the score breakdown: verdict, headline, summary, factors, cautions, model, cache state and the disclaimer.

## Remaining scaffolds

`/alerts` and `/settings` still state plainly that they are unbuilt — the tables and server functions behind them exist, but there is no auth UI yet to sign in with. Honest scaffolds, not dead buttons.

## Conventions

| Pattern                  | URL                                       |
| ------------------------ | ----------------------------------------- |
| `users/$id.tsx`          | `/users/:id` — bare `$`, no braces        |
| `posts/{-$category}.tsx` | `/posts/:category?`                       |
| `files/$.tsx`            | `/files/*` — read via `_splat`            |
| `_layout.tsx`            | pathless layout; must render `<Outlet />` |

Do not create `src/pages/`, `src/routes/_app/index.tsx`, or `app/layout.tsx`. The only root layout is `__root.tsx`, and an `_app/index.tsx` would duplicate `/`.

## Head metadata

Every content route defines its own `head()` with a unique title, description, `og:title`, and `og:description`. `og:type` and `twitter:card` are set. `/` carries the poster still as an absolute `og:image` / `twitter:image`; `__root` carries neither.


---

# 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, and the optional `goal` query parameter:

```
GET https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/reference/routes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
