# dexMetrics **Type:** GraphQL queries **Description:** Retrieve key metrics for the decentralized exchange (DEX), including total value locked (TVL), trading volume, and pool count, with optional historical data. This query aggregates protocol-level statistics across all pools under a supported DEX (currently limited to the Sushi-integrated deployment) and is commonly used by dashboards, explorers, and analytics tools to visualize network-wide DeFi activity. If `startDate` and `endDate` are not provided, the query defaults to a 30-day historical range. Use `protocolAddress` to filter metrics for a specific DEX module on Kadena. Returned data includes the current TVL, total pool count, total volume over the selected period, and historical time series data for both TVL and volume. ## Arguments - startDate (DateTime): (Optional) Start date for the historical range used to calculate TVL and volume metrics. - endDate (DateTime): (Optional) End date for the historical range used to calculate TVL and volume metrics. - protocolAddress (String): (Optional) Filter metrics by the protocol’s module name on Kadena. Useful when multiple DEX protocols are supported. ## Response **Type:** DexMetrics **Description:** Aggregated performance metrics for a decentralized exchange (DEX). `DexMetrics` provides a snapshot and historical overview of network-wide DeFi activity, including total liquidity (TVL), trading volume, and the number of active pools. It is designed for powering dashboards, analytics views, and protocol-level insights. All USD-denominated values (TVL, volume) are calculated using price data from DIA, and historical data is shaped by the time range specified in the query (defaults to 30 days if none is provided). ### Fields - totalPools (Int): The total number of liquidity pools deployed under the protocol. - currentTvlUsd (Decimal): The current total value locked (TVL) across all pools, expressed in USD. This reflects the combined liquidity available in the protocol at the time of the query. - tvlHistory (ChartDataPoint): Historical time-series data points representing TVL evolution over the selected time range. Useful for charting liquidity growth and analyzing protocol trends. - volumeHistory (ChartDataPoint): Historical time-series data points representing trading volume over the selected time range. Useful for charting market activity and usage patterns. - totalVolumeUsd (Decimal): The total cumulative trading volume (in USD) observed over the specified time range.