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

# Partner Stats

> Query your partner volume, weekly breakdowns, and time-series chart data

# Partner Stats

The stats endpoints return metrics scoped to your partner account — not platform-wide totals. Use them to build dashboards, monitor performance, or integrate your volume data into internal reporting.

<Note>
  All stats endpoints require full API key authentication (`Authorization: <partnerId>:<apiSecret>`). The public `partner-id` header does not grant access.
</Note>

## GET /v2/stats/volume

Returns cumulative volume metrics for your partner account.

### Endpoint

```
GET /v2/stats/volume
```

### Parameters

None.

### Example Request

```bash theme={null}
curl -X GET "https://api-partner.houdiniswap.com/v2/stats/volume" \
  -H "Authorization: <partnerId>:<apiSecret>"
```

### Example Response

```json theme={null}
{
  "count": 1284,
  "totalTransactedUSD": 4821903.55,
  "totalOrders": 1284,
  "thisMonthVolumeUsd": 312450.20,
  "lastMonthVolumeUsd": 498201.75,
  "thisMonthOrders": 215
}
```

### Response Fields

| Field                | Type   | Description                                             |
| -------------------- | ------ | ------------------------------------------------------- |
| `count`              | number | Total completed transactions (all time)                 |
| `totalTransactedUSD` | number | Total transacted value in USD (all time)                |
| `totalOrders`        | number | Alias for `count`                                       |
| `thisMonthVolumeUsd` | number | Transacted value in USD for the current calendar month  |
| `lastMonthVolumeUsd` | number | Transacted value in USD for the previous calendar month |
| `thisMonthOrders`    | number | Completed transactions in the current calendar month    |

***

## GET /v2/stats/weeklyVolume

Returns a per-week breakdown of your partner volume, ordered chronologically.

### Endpoint

```
GET /v2/stats/weeklyVolume
```

### Parameters

None.

### Example Request

```bash theme={null}
curl -X GET "https://api-partner.houdiniswap.com/v2/stats/weeklyVolume" \
  -H "Authorization: <partnerId>:<apiSecret>"
```

### Example Response

```json theme={null}
[
  {
    "week": 15,
    "year": 2026,
    "count": 87,
    "anonymous": 34,
    "volume": 41250.00,
    "commission": 103.13
  },
  {
    "week": 16,
    "year": 2026,
    "count": 112,
    "anonymous": 45,
    "volume": 58930.50,
    "commission": 147.33
  }
]
```

### Response Fields

| Field        | Type   | Description                                |
| ------------ | ------ | ------------------------------------------ |
| `week`       | number | ISO week number (1–53)                     |
| `year`       | number | Year                                       |
| `count`      | number | Total transactions for the week            |
| `anonymous`  | number | Number of private (anonymous) transactions |
| `volume`     | number | Total transaction volume in USD            |
| `commission` | number | Commission earned in USD for the week      |

***

## GET /v2/stats/chart

Returns time-series data for a given metric over a custom date range. Useful for building volume charts in dashboards or analytics tools.

### Endpoint

```
GET /v2/stats/chart
```

### Parameters

| Field         | Type   | Required | Description                                            |
| ------------- | ------ | -------- | ------------------------------------------------------ |
| `metric`      | string | Yes      | Metric to chart. Currently supported: `volume`         |
| `from`        | string | Yes      | Start of range (ISO 8601, e.g. `2026-01-01T00:00:00Z`) |
| `to`          | string | Yes      | End of range (ISO 8601, e.g. `2026-04-22T23:59:59Z`)   |
| `granularity` | string | No       | Bucket size: `day` (default) or `month`                |

### Example Request

```bash theme={null}
curl -X GET "https://api-partner.houdiniswap.com/v2/stats/chart?metric=volume&from=2026-03-23T00:00:00Z&to=2026-04-22T23:59:59Z&granularity=day" \
  -H "Authorization: <partnerId>:<apiSecret>"
```

### Example Response

```json theme={null}
[
  { "date": "2026-03-23", "volumeUsd": 12430.50, "count": 28 },
  { "date": "2026-03-24", "volumeUsd": 9870.00, "count": 21 },
  { "date": "2026-03-25", "volumeUsd": 15210.75, "count": 35 }
]
```

### Response Fields

| Field       | Type   | Description                                                        |
| ----------- | ------ | ------------------------------------------------------------------ |
| `date`      | string | Bucket date. Format: `YYYY-MM-DD` for `day`, `YYYY-MM` for `month` |
| `volumeUsd` | number | Total transacted value in USD for the bucket                       |
| `count`     | number | Number of completed transactions in the bucket                     |

<Note>
  Days or months with no activity are omitted from the response. Your charting code should fill in zero values for missing dates.
</Note>

***

## Code Example

Fetch all three stats endpoints and log a summary:

```typescript theme={null}
const BASE = "https://api-partner.houdiniswap.com/v2";
const AUTH = `${process.env.PARTNER_ID}:${process.env.API_SECRET}`;

const headers = { Authorization: AUTH };

// Volume summary
const volumeRes = await fetch(`${BASE}/stats/volume`, { headers });
const volume = await volumeRes.json();
console.log(`All-time: ${volume.count} orders / $${volume.totalTransactedUSD.toFixed(2)}`);
console.log(`This month: ${volume.thisMonthOrders} orders / $${volume.thisMonthVolumeUsd.toFixed(2)}`);

// Last 30 days chart (daily granularity)
const to = new Date().toISOString();
const from = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString();
const chartRes = await fetch(
  `${BASE}/stats/chart?metric=volume&from=${from}&to=${to}&granularity=day`,
  { headers }
);
const chart = await chartRes.json();
console.log(`Chart data points: ${chart.length}`);

// Weekly breakdown
const weeklyRes = await fetch(`${BASE}/stats/weeklyVolume`, { headers });
const weekly = await weeklyRes.json();
const latestWeek = weekly[weekly.length - 1];
console.log(`Week ${latestWeek.week}/${latestWeek.year}: $${latestWeek.volume} volume, $${latestWeek.commission} commission`);
```
