> ## 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 Update History

> Get strategy updates over time



## OpenAPI

````yaml /api-specs/public-rest-unified.json get /exchange/api/v1/strategy_updates
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:
  /exchange/api/v1/strategy_updates:
    get:
      tags:
        - Market
      summary: Get Strategy Update History
      description: Get strategy updates over time
      parameters:
        - in: query
          name: trader
          schema:
            type: string
          description: The trader address, with the discriminant prefix.
          example: '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
        - in: query
          name: strategyIdHash
          schema:
            type: string
          description: The strategy id hash.
          example: 628550609
        - name: reason
          in: query
          schema:
            type: integer
            enum:
              - 0
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
              - 7
              - 8
              - 9
          example: 0
          description: >
            The type of strategy update. Multiple strategy update values can be
            provided. Values include:
              0: Deposit - Collateral was deposited on-chain,
              1: Withdraw - Collateral withdrawal was claimed on-chain,
              2: WithdrawIntent - Collateral was locked for withdrawal,
              3: FundingPayment - Funding payments were distributed,
              4: PnlSettlement - PnL was realized,
              5: Trade,
              6: Fee,
              7: Liquidation,
              8: ADL - ADL occurred on one or more positions,
              9: Withdraw Rejection.
        - in: query
          name: limit
          schema:
            type: integer
            default: 500
          description: The number of rows to return
        - in: query
          name: globalOrdinal
          schema:
            type: integer
          description: >-
            The global ordinal boundary used when fetching the next timeseries
            page.
          example: 100
        - in: query
          name: order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: The ordering of the results.
      responses:
        '200':
          description: Strategy update data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeAPIStrategyUpdateSuccessResponse'
        '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:
    ExchangeAPIStrategyUpdateSuccessResponse:
      type: object
      additionalProperties: false
      properties:
        nextGlobalOrdinal:
          type:
            - number
            - 'null'
          description: >-
            Pointer for the global ordinal boundary of the next page. Will
            return null when there is no more data left to fetch.
          examples:
            - 100
            - null
        value:
          type: array
          items:
            type: object
            properties:
              globalOrdinal:
                type: number
                description: >-
                  The global ordinal for a strategy update that identifies it
                  uniquely.
                examples:
                  - 9
              epochId:
                type: number
                description: The epoch in which this transaction occured.
              txOrdinal:
                type: number
                description: The transaction ordinal, within the epoch.
                examples:
                  - 3432
              ordinal:
                type: number
                description: The ordinal within this particular transaction.
                examples:
                  - 0
              withdrawRejection:
                type: number
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                description: >-
                  The withdraw rejection type when applicable. Optional field
                  only present on rejections.
                examples:
                  - 0
              reason:
                type: number
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                  - 6
                  - 7
                description: The reason of strategy update.
                examples:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
              traderAddress:
                type: string
                description: The trader address prefixed with the blockchain discriminant.
                examples:
                  - '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
              strategyIdHash:
                type: string
                description: The strategy id hash of the trader.
                examples:
                  - '0x2576ebd1'
              collateralAddress:
                type: string
                description: >-
                  The collateral address on which this strategy update took
                  place.
                examples:
                  - '0x8ea76477cfaca8f7ea06477fd3c09a740ac6012a'
              collateralSymbol:
                type: string
                description: >-
                  The collateral symbol on which this strategy update took
                  place.
                examples:
                  - USDC
              amount:
                type: string
                description: The amount that was modified in the strategy.
                examples:
                  - '1000'
              newAvailCollateral:
                type: string
                description: >-
                  If affected, the updated available collateral amount after
                  this strategy update. Not present on Adl reason.
                examples:
                  - '10000'
              newLockedCollateral:
                type: string
                description: >-
                  If affected, the updated locked collateral amount after this
                  strategy update. Not present on Adl reason.
                examples:
                  - '10000'
              blockNumber:
                type: number
                description: >-
                  The block number in which this strategy update was processed.
                  Not present on Adl reason.
                examples:
                  - '344100'
              txHash:
                type: string
                description: >-
                  The on-chain transaction hash corresponding to this strategy
                  update
                examples:
                  - >-
                    0xfcdae2edac7063ae3a3fb0e74b48816a0593644a3b2f5d701c8e5fafec70828e
              positions:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol affected.
                      examples:
                        - ETHP
                    side:
                      type: number
                      enum:
                        - 0
                        - 1
                      description: >-
                        The side. Only present on Adl strategy update. Values
                        include:  0: Bid,  1: Ask
                      examples:
                        - 0
                        - 1
                    avgEntryPrice:
                      type: string
                      description: >-
                        After a RealizedPnl strategy update, what the new
                        average entry prices is for this strategies open
                        positions.
                      examples:
                        - '1500'
                    realizedPnl:
                      type: string
                      description: >-
                        After a RealizedPnl or Adl strategy update, what the
                        realized pnl is for this strategies open positions.
                      examples:
                        - '1500'
                  required:
                    - symbol
                    - realizedPnl
                  additionalProperties: false
                  description: >-
                    A position with fields and values affected by the strategy
                    update.
                description: >-
                  The position fields and values affected by this strategy
                  update.
              createdAt:
                type: string
                format: date-time
                description: The time when this row was added to the database.
                examples:
                  - '2023-01-06T16:37:27.929Z'
            required:
              - globalOrdinal
              - epochId
              - reason
              - traderAddress
              - strategyIdHash
              - createdAt
            additionalProperties: false
            description: A transaction which represents an update to a strategy.
          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:
        - nextGlobalOrdinal
        - success
        - timestamp
        - value
      description: Successful response for the Strategy Update 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

````