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

# Quickstart

> Get a real Pegana response in 5 minutes. Pick your stack.

No signup. No API key. No wallet. Pick one of the snippets below and run it.

## Read one peg state

<CodeGroup>
  ```bash curl theme={"theme":"github-dark"}
  curl https://api.pegana.xyz/v1/assets/USDC/state
  ```

  ```typescript Node / TypeScript theme={"theme":"github-dark"}
  const res = await fetch("https://api.pegana.xyz/v1/assets/USDC/state");
  const state = await res.json();
  console.log(state);
  ```

  ```python Python theme={"theme":"github-dark"}
  import requests
  state = requests.get("https://api.pegana.xyz/v1/assets/USDC/state").json()
  print(state)
  ```

  ```rust Rust theme={"theme":"github-dark"}
  let state: serde_json::Value = reqwest::get("https://api.pegana.xyz/v1/assets/USDC/state")
      .await?
      .json()
      .await?;
  println!("{state:#}");
  ```
</CodeGroup>

You get back:

```json theme={"theme":"github-dark"}
{
  "asset": "USDC",
  "state": "PEGGED",
  "since": "2026-05-29T19:26:24Z",
  "discount": "0.000298",
  "intrinsic_usd": "1.000000000000000000",
  "market_usd": "0.999712360000000000"
}
```

Numeric fields are returned as strings to preserve full on-chain precision —
parse them with your language's decimal type, not a float.

That's it. No auth, no rate-limit headers to parse for casual use, no SDK to install.

## Stream every state change

If you need sub-second updates instead of polling, open a WebSocket:

<CodeGroup>
  ```bash wscat theme={"theme":"github-dark"}
  wscat -c wss://api.pegana.xyz/v1/ws
  ```

  ```typescript Node / TypeScript theme={"theme":"github-dark"}
  import WebSocket from "ws";

  const ws = new WebSocket("wss://api.pegana.xyz/v1/ws");
  ws.on("message", (data) => {
    const msg = JSON.parse(data.toString());
    if (msg.op === "update") console.log(msg.asset, msg.payload);
  });
  ```
</CodeGroup>

The server pushes `{op:"update", asset, payload}` whenever any asset state changes,
plus a heartbeat every 5 seconds. See [WebSocket guide](/docs/guides/websocket) for
filtering by asset.

## Add Pegana to Claude / Cursor (MCP)

If you're using an MCP-capable client, ask the model directly:

```text Paste into Claude / Cursor theme={"theme":"github-dark"}
"Check the current peg state for USDC, jitoSOL and hyUSD via Pegana.
 Summarize anything in DRIFT or worse with the spread bps."
```

Configure your MCP host once. The server is **hosted at `https://mcp.pegana.xyz`** —
no install, no clone:

```json claude_desktop_config.json theme={"theme":"github-dark"}
{
  "mcpServers": {
    "pegana": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.pegana.xyz"]
    }
  }
}
```

`mcp-remote` is an official bridge that proxies the HTTP MCP transport into stdio
for hosts that don't yet support HTTP natively (most as of 2026-05). It auto-installs
via npx the first time it runs. Restart your MCP host and the Pegana tools appear.

Free tools: `get_assets`, `get_asset_state`, `get_methodology`. Paid tools
(`get_asset_history`, `subscribe_peg_events`) settle via
[x402 in USDC](/docs/guides/mcp-paid-tools-x402), $0.001 – $0.0005 per call.

## Get alerts on Telegram

No code, no integration. Open the bot:

<Card title="@PeganaWatchBot" icon="telegram" href="https://t.me/PeganaWatchBot">
  Subscribe to any asset · custom thresholds · English.
</Card>

## Next

<CardGroup cols={2}>
  <Card title="Pick your channel" icon="list-tree" href="/docs/guides/rest-api">
    Full reference for REST, WebSocket, MCP, Webhook, Embed, Telegram.
  </Card>

  <Card title="How peg state is computed" icon="equals" href="/docs/methodology/overview">
    The formula, sources and FSM thresholds.
  </Card>

  <Card title="Case studies" icon="book-open" href="/docs/case-studies/overview">
    Five real depegs in detail — USDC-SVB, UST, mSOL, DAI, GHO.
  </Card>

  <Card title="API reference" icon="code" href="/docs/api-reference/introduction">
    Live OpenAPI reference for annotated HTTP endpoints.
  </Card>
</CardGroup>
