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

# Protocol statistics

> Returns aggregate market statistics used by the Exponent app.

export const ApiResponse = ({children, errors = {}}) => {
  const [status, setStatus] = useState("200");
  const statuses = ["200", ...Object.keys(errors)];
  return <section className="api-response" aria-label="Response">
      <div className="api-response-header not-prose">
        <h2>Response</h2>
        <div className="api-response-format">
          {statuses.length > 1 ? <select aria-label="Response status" value={status} onChange={event => setStatus(event.target.value)}>
              {statuses.map(code => <option key={code} value={code}>{code}</option>)}
            </select> : <span>200</span>}
          <span className="api-response-mime">application/json</span>
        </div>
      </div>
      <div hidden={status !== "200"}>{children}</div>
      {status !== "200" && <div aria-live="polite">
          {Object.entries(errors[status]).map(([name, value]) => <ResponseField key={name} name={name} type={value === null ? "null" : Array.isArray(value) ? "array" : typeof value}>
              {name === "error" ? "Error message describing why the request failed." : "Additional error details."}
            </ResponseField>)}
        </div>}
    </section>;
};

<RequestExample dropdown>
  ```bash cURL theme={null}
  curl https://api.exponent.finance/market-stats
  ```

  ```python Python theme={null}
  import requests

  response = requests.get("https://api.exponent.finance/market-stats", timeout=30)
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.exponent.finance/market-stats");
  if (!response.ok) {
    throw new Error(`Request failed: ${response.status}`);
  }
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ApiResponse errors={{"502": {"error": "Failed to fetch market stats"}}}>
  <ResponseField name="totalVolume" type="number">
    Aggregate trading volume in USD.
  </ResponseField>

  <ResponseField name="totalValueLocked" type="number">
    Total value locked in USD.
  </ResponseField>

  <ResponseField name="totalYieldSettled" type="number">
    Aggregate PT redemption value in USD.
  </ResponseField>

  <ResponseField name="uniqueUsers" type="number">
    Number of unique protocol users.
  </ResponseField>

  <ResponseField name="totalVolumeFormatted" type="string">
    Compact display value for trading volume.
  </ResponseField>

  <ResponseField name="totalValueLockedFormatted" type="string">
    Compact display value for TVL.
  </ResponseField>

  <ResponseField name="totalYieldSettledFormatted" type="string">
    Compact display value for settled yield.
  </ResponseField>

  <ResponseField name="uniqueUsersFormatted" type="string">
    Compact display value for unique users.
  </ResponseField>
</ApiResponse>

<ResponseExample>
  ```json 200 theme={null}
  {
    "totalVolume": 3041928569.7757893,
    "totalYieldSettled": 385691290.52773446,
    "uniqueUsers": 35677,
    "totalValueLocked": 92533710.97,
    "expiresAt": 1791996727694,
    "uniqueUsersFormatted": "36K",
    "totalVolumeFormatted": "$3.04B+",
    "totalValueLockedFormatted": "$92.53M",
    "totalYieldSettledFormatted": "$385.69M+"
  }
  ```

  ```json 502 theme={null}
  {
    "error": "Failed to fetch market stats"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.