# Legacy Support

## GET /legacysupport/metric

> Get legacy metrics (daily and total) for compatibility with pear-backend metric service

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"paths":{"/legacysupport/metric":{"get":{"operationId":"LegacySupportController_getLegacyMetrics","parameters":[{"name":"timestamp","required":false,"in":"query","description":"Start of day timestamp (in seconds). Defaults to previous day window.","schema":{"type":"number"}}],"responses":{"200":{"description":"Legacy metrics fetched successfully","content":{"application/json":{"schema":{"type":"object","properties":{"totalVolume":{"type":"number"},"totalUsers":{"type":"number"},"dailyVolume":{"type":"number"},"dailyFees":{"type":"number"},"totalFees":{"type":"number"}}}}}}},"summary":"Get legacy metrics (daily and total) for compatibility with pear-backend metric service","tags":["Legacy Support"]}}}}
```

## GET /legacysupport/weeklyVolume

> Get weekly and monthly volumes for legacy support

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"paths":{"/legacysupport/weeklyVolume":{"get":{"operationId":"LegacySupportController_getLegacyWeeklyVolume","parameters":[{"name":"timestamp","required":false,"in":"query","description":"Start of day timestamp (in seconds). Aligns end of windows the same as /metric.","schema":{"type":"number"}}],"responses":{"200":{"description":"Weekly and monthly volumes"}},"summary":"Get weekly and monthly volumes for legacy support","tags":["Legacy Support"]}}}}
```

## GET /legacysupport/stats/hyperliquid

> Get hyperliquid user stats for legacy support (V2)

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"paths":{"/legacysupport/stats/hyperliquid":{"get":{"operationId":"LegacySupportController_getLegacyHyperliquidStats","parameters":[{"name":"address","required":true,"in":"query","description":"User address","schema":{"type":"string"}},{"name":"period","required":false,"in":"query","description":"Period label (e.g., daily)","schema":{"type":"string"}},{"name":"startDate","required":false,"in":"query","description":"Start date ISO string","schema":{"type":"string"}}],"responses":{"200":{"description":"Hyperliquid user stats"}},"summary":"Get hyperliquid user stats for legacy support (V2)","tags":["Legacy Support"]}}}}
```

## GET /legacysupport/dailyStats

> Get legacy daily stats (volume, fees, users, new\_traders) for compatibility with pear-backend /statsData

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"paths":{"/legacysupport/dailyStats":{"get":{"operationId":"LegacySupportController_getLegacyDailyStats","parameters":[{"name":"period","required":false,"in":"query","description":"Period label, e.g., daily","schema":{"type":"string"}},{"name":"startDate","required":false,"in":"query","description":"Start date ISO string","schema":{"type":"string"}},{"name":"endDate","required":false,"in":"query","description":"End date ISO string","schema":{"type":"string"}}],"responses":{"200":{"description":"Daily stats array"}},"summary":"Get legacy daily stats (volume, fees, users, new_traders) for compatibility with pear-backend /statsData","tags":["Legacy Support"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pearprotocol.io/api-integration/api-specification/legacy-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
