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

# llms.txt

> Nile Markets documentation is auto-indexed via llms.txt and llms-full.txt at docs.nilemarkets.com — AI agents use these files to discover protocol documentation, tools, and integration patterns.

Nile Markets publishes machine-readable documentation indexes following the [llms.txt specification](https://llmstxt.org/). AI agents and LLM applications use these files to discover and consume protocol documentation without manual curation.

## Endpoints

| URL                                  | Content                                 | Size    |
| ------------------------------------ | --------------------------------------- | ------- |
| `docs.nilemarkets.com/llms.txt`      | Page index with titles and descriptions | Compact |
| `docs.nilemarkets.com/llms-full.txt` | Full rendered content of every page     | Large   |

Both files are also served at the well-known paths:

* `docs.nilemarkets.com/.well-known/llms.txt`
* `docs.nilemarkets.com/.well-known/llms-full.txt`

## How It Works

Mintlify auto-generates both files from page frontmatter. Every MDX page with a `title` and `description` in its YAML frontmatter is included automatically.

```yaml theme={null}
---
title: "Margin Requirements"
description: "Initial margin = notional / leverage; maintenance = initial × 80%. Positions below maintenance margin trigger liquidation."
---
```

The `description` field becomes the page summary in `llms.txt`. This is why every page description in the Nile Markets docs is a self-contained sentence describing the key concept or formula — not a generic "Learn about X" placeholder.

### Auto-Discovery

Mintlify adds an HTTP `Link` header to every page response:

```http theme={null}
Link: </llms.txt>; rel="llms-txt"
```

LLM clients that support the `llms-txt` link relation can discover the index automatically from any page on the docs site.

## Feeding Docs to an Agent

### Full Context Loading

For agents with large context windows, load the complete documentation:

```bash theme={null}
curl -s https://docs.nilemarkets.com/llms-full.txt
```

This returns the rendered Markdown content of every page — protocol mechanics, parameter tables, integration guides, and API references — in a single request.

### Selective Loading

For smaller context budgets, start with the index and fetch individual pages:

```bash theme={null}
# Get the page index with descriptions
curl -s https://docs.nilemarkets.com/llms.txt

# Fetch a specific page as Markdown
curl -s https://docs.nilemarkets.com/protocol/margin-requirements.md
```

### Markdown Export

Any page URL on the docs site supports Markdown export via two methods:

* **File extension**: append `.md` to the URL path (e.g., `docs.nilemarkets.com/protocol/pnl.md`)
* **Accept header**: request with `Accept: text/markdown`

```bash theme={null}
# Using file extension
curl -s https://docs.nilemarkets.com/protocol/oracle-pricing.md

# Using Accept header
curl -s -H "Accept: text/markdown" https://docs.nilemarkets.com/protocol/oracle-pricing
```

Both methods return the page content as clean Markdown, stripped of HTML components and navigation chrome.

## Page Description Best Practices

The `llms.txt` index is only as useful as the page descriptions. Nile Markets docs follow these conventions:

<Columns cols={2}>
  <Card title="Good Descriptions" icon="check">
    Self-contained sentences that include the key formula, parameter, or concept.

    * "PnL = notional x (currentPrice - entryStrike) / PRICE\_PRECISION for LONG; losses capped at locked margin"
    * "Initial margin = notional / leverage; maintenance = initial x 80%"
    * "Connect AI agents directly to the Nile Markets subgraph via The Graph's hosted MCP server"
  </Card>

  <Card title="Avoid" icon="xmark">
    Generic placeholders that don't help an LLM decide whether to read the page.

    * "How profit and loss is calculated"
    * "Learn about margin requirements"
    * "Overview of the MCP integration"
  </Card>
</Columns>

When an LLM sees the index, a good description provides enough context to decide whether the page contains relevant information — without needing to fetch the full content.

## Architecture

```
Mintlify build
    │
    ├── reads frontmatter from every .mdx page
    │
    ├── generates llms.txt (titles + descriptions)
    │
    ├── generates llms-full.txt (full rendered content)
    │
    ├── serves at /llms.txt and /.well-known/llms.txt
    │
    └── adds Link: </llms.txt>; rel="llms-txt" header
```

Zero maintenance required. When you add, edit, or remove a docs page, the llms.txt files update automatically on the next deploy.
