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

# Get Strategy Metrics

> Get KPIs and risk metrics for a strategy, like margin fraction, maintenance margin ratio, leverage, strategy available collateral and strategy value.



## OpenAPI

````yaml /api-specs/public-rest-unified.json get /stats/api/v1/strategy_metrics
openapi: 3.1.0
info:
  title: DerivaDEX API Documentation
  version: '1.0'
  description: ''
servers:
  - url: https://testnet.derivadex.io
    description: DerivaDEX testnet
security: []
tags:
  - name: Venue-Wide Tables
    description: These APIs expose venue-wide public tables and reference data.
    x-source-api: Public REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public Exchange REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public Exchange REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public Exchange REST API
paths:
  /stats/api/v1/strategy_metrics:
    get:
      tags:
        - Trade
      summary: Get Strategy Metrics
      description: >-
        Get KPIs and risk metrics for a strategy, like margin fraction,
        maintenance margin ratio, leverage, strategy available collateral and
        strategy value.
      parameters:
        - in: query
          name: trader
          schema:
            type: string
          required: true
          description: The trader address.
          example: '0xb993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
        - in: query
          name: strategyId
          schema:
            type: string
          required: true
          description: The strategy ID.
          example: main
      responses:
        '200':
          description: Strategy metrics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyMetricsAPISuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
components:
  schemas:
    StrategyMetricsAPISuccessResponse:
      type: object
      additionalProperties: false
      properties:
        value:
          anyOf:
            - type: object
              properties:
                marginFraction:
                  type: string
                  description: The current margin fraction of the strategy.
                  examples:
                    - '999999999999'
                mmr:
                  type: string
                  description: >-
                    The maintenance margin ratio. The margin fraction of the
                    strategy should be greater than this number, or it may be
                    subject to liquidation.
                  examples:
                    - '0.05'
                leverage:
                  type: string
                  description: The current leverage of the strategy.
                  examples:
                    - '3'
                strategyMargin:
                  type: string
                  description: >-
                    The amount of unsettled margin and unutilized collateral
                    available for new trades, or as a buffer against losses.
                  examples:
                    - '6147.5'
                strategyValue:
                  type: string
                  description: The total value of all positions owned by this strategy.
                  examples:
                    - '9233.3'
              required:
                - marginFraction
                - mmr
                - leverage
                - strategyMargin
                - strategyValue
              additionalProperties: false
              description: Strategy metrics
              examples:
                - marginFraction: '999999999999'
                  mmr: '0.05'
                  leverage: '3'
                  strategyMargin: '6147.5'
                  strategyValue: '9233.3'
            - type: 'null'
              description: >-
                The value will be null if there is no value for the parameters
                used.
              examples:
                - null
          description: The value of the response.
        success:
          type: boolean
          const: true
          description: Whether the request was successful
        timestamp:
          type: number
          description: The timestamp of the response
          examples:
            - 1673031089
      required:
        - success
        - timestamp
        - value
      description: Successful response for the Strategy Metrics API
    StatsAPIErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errorMsg:
          anyOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: false
      required:
        - success
      additionalProperties: false

````