---
title: "Get trade stats"
method: GET
path: "/evm/rh/trade-stats"
tags: ["Robinhood Chain"]
---

# Get trade stats

`GET /evm/rh/trade-stats`

## Request

- Base URL: `https://public-api-v2.bags.fm/api/v1`
- URL: `https://public-api-v2.bags.fm/api/v1/evm/rh/trade-stats`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/bags/apis/bags-public-api-v2/docs/evm/rh/trade-stats/get.ts> (a function with typed inputs; its response is checked against the schema)

Get a server-side trade aggregate for a Bags V2 token on Robinhood Chain over a rolling window (volume, transaction counts, last price).

The aggregate streams the full window from the subgraph; `truncated` is `true` only in the pathological case where the window exceeds the ~500k-trade safety bound, in which case `volumeEthWei` and counts are a lower bound.

## Query parameters

- `tokenAddress` string, required
- `windowSecs` number

## Response `200`

Successfully retrieved trade stats

- object
  - `success` boolean, required
  - `response` object
    - `windowSecs` number, required: Aggregation window in seconds.
    - `volumeEthWei` string, required: Total ETH volume within the window (wei), as string to support bigint.
    - `txCount` number, required: Total number of trades within the window.
    - `buyCount` number, required: Number of buys within the window.
    - `sellCount` number, required: Number of sells within the window.
    - `truncated` boolean, required: True only in the pathological case where the window exceeded the ~500k-trade safety bound before being fully scanned; volume and counts are then a lower bound. False on the normal path.
    - `lastPriceEthPerToken` string, nullable, required: Spot price after the most recent trade, as an 1e18 fixed-point decimal string (ETH per whole token). Null when the token has no trades.
    - `lastTradeTimestamp` number, nullable, required: Unix-seconds timestamp of the most recent trade. Null when the token has no trades.

## Other responses

- `400`: Bad request - Invalid token address or window
- `401`: Unauthorized - Invalid or missing API key
- `500`: Internal server error

---

[API](https://skmtc.dev/bags/apis/bags-public-api-v2.md) - [All operations](https://skmtc.dev/bags/apis/bags-public-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/bags/apis/bags-public-api-v2/revisions/4a14b82cd39d?raw)
