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

# Markets and swaps

> Read Tulip market summaries and recent canonical swaps from the indexer.

## Health

```http theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
GET /health
```

Returns service status, chain ID, factory, cursor, indexed market and swap counts, head and indexed blocks, lag, last successful poll, and the latest error.

## List markets

```http theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
GET /v1/markets
```

Returns every canonical market discovered from the configured factory.

## Read one market

```http theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
GET /v1/markets/{modelId}?limit=100
```

`limit` controls recent trades and is bounded from `1` to `250`.

The response contains:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "summary": {
    "modelId": "0x...",
    "poolId": "0x...",
    "priceUsdG": "0.00000124",
    "tvlUsdG": "28341.18",
    "volume24hUsdG": "9152.44",
    "creditsTraded24h": "7210485312.50",
    "updatedAt": "2026-07-14T14:12:28.541Z"
  },
  "trades": [
    {
      "transactionHash": "0x...",
      "timestamp": "2026-07-14T14:11:04.000Z",
      "side": "buy",
      "priceUsdG": "0.00000124",
      "creditAmount": "80645161.29",
      "quoteAmount": "100.00"
    }
  ]
}
```

Summary fields may be `null` before the first indexed swap or when the required state is unavailable.

## Buy and sell classification

The indexer accounts for whether the credit is currency 0 or currency 1. A buy means the trader paid USDG and received credits. A sell means the trader paid credits and received USDG.

<Info>
  The indexed sender is the address emitted by `PoolManager`, which may be a router rather than the end user's wallet.
</Info>
