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

# Route Template & Catalog Integrity

> How the Bazaar keeps dynamic routes uniquely addressable and prevents catalog spam.

Dynamic routes and open registration are a natural source of catalog spam. The Bazaar has two mechanisms to keep listings well-formed and hard to abuse: route templates and integrity signals.

## Route templates

A listing's `resource` is stored as a **route template** rather than a concrete URL. `https://api.example.com/weather/{lat}/{lng}` is one listing. `https://api.example.com/weather/47.6/-122.3` and `https://api.example.com/weather/40.7/-74.0` are not two listings — they collapse to the same template.

The middleware infers the template from the route definition (Express `/weather/:lat/:lng`, FastAPI `/weather/{lat}/{lng}`, etc.). Sellers can override it in `describe.template`.

An agent invoking a templated listing substitutes the template variables from its own inputs. The `inputSchema` in `describe.inputs` declares which variables exist and their types.

## Integrity signals

Each listing carries derived signals used to detect abuse:

* **Verify-to-settle ratio.** A listing that generates many `/verify` calls but few settlements is either misbehaving or being probed. Persistent low ratios drop rank sharply.
* **Rejection distribution.** A listing whose rejections are mostly `resource_gone` gets delisted. A listing whose rejections are mostly `insufficient_funds` is fine — that is a buyer problem, not a seller one.
* **Duplicate detection.** Two listings from the same `payTo` with near-identical `describe` blocks are merged into one, with the second's signals folded into the first's.

## What operators can tune

| Config key                      | Default | Purpose                                               |
| ------------------------------- | ------- | ----------------------------------------------------- |
| `DISCOVERY_DELIST_AFTER_HOURS`  | 24      | Consecutive-failure window before delisting.          |
| `DISCOVERY_DUPLICATE_THRESHOLD` | 0.9     | Cosine similarity above which two listings merge.     |
| `DISCOVERY_MIN_SETTLE_RATIO`    | 0.1     | Below this verify-to-settle ratio, rank is penalized. |

See [Configuration Reference](/guides/operators/configuration-reference).
