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

# Correlation, Beta and Realized Volatility

> This endpoint returns the entire series of closing prices for two selected currency pairs from a given exchange. In addition to the series of closing prices the endpoint also returns the various realized volatility measures (using the high/low Parkinson method), rolling correlation calculation and beta. Beta is a measure of the second pair, in terms of the first pair.



## OpenAPI

````yaml get /analytics/realized-volatility/correlation-beta
openapi: 3.1.0
info:
  title: derivatives-api
  version: '2'
servers:
  - url: https://api.amberdata.com/markets/derivatives
security:
  - sec0: []
paths:
  /analytics/realized-volatility/correlation-beta:
    get:
      summary: Correlation, Beta and Realized Volatility
      description: >-
        This endpoint returns the entire series of closing prices for two
        selected currency pairs from a given exchange. In addition to the series
        of closing prices the endpoint also returns the various realized
        volatility measures (using the high/low Parkinson method), rolling
        correlation calculation and beta. Beta is a measure of the second pair,
        in terms of the first pair.
      operationId: derivatives-realized-volatility-correlation-beta
      parameters:
        - name: exchange
          in: query
          description: >-
            **[Required]**  The exchange for which to retrieve the volatility
            cone. 

            **[Examples]** `gdax`
          required: true
          schema:
            type: string
            default: gdax
        - name: pair
          in: query
          description: >-
            **[Required]** The underlying pair for which to retrieve the
            volatility cone. 

            **[Examples]** `btc_usd`
          required: true
          schema:
            type: string
            default: btc_usd
        - name: pair2
          in: query
          description: >-
            **[Required]** The underlying pair for which to retrieve the
            volatility cone. 

            **[Examples]** `btc_usd`
          required: true
          schema:
            type: string
            default: crv_usd
        - name: timeFormat
          in: query
          description: >-
            **[Optional]** Time format of the timestamps in the return payload.

            **[Defaults]** `milliseconds | ms* | iso | iso8601 | hr |
            human_readable`
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: integer
                              example: 1717891200000
                              description: >-
                                The timestamp for the correlation and volatility
                                data point in milliseconds
                            pairOne:
                              type: string
                              example: btc_usd
                              description: The first trading pair identifier
                            closeOne:
                              type: number
                              example: 69637.87
                              description: The closing price for the first pair
                            returnOne:
                              type: number
                              example: 0.004805182515383674
                              description: The return for the first pair
                            realizedVolatility30One:
                              type: number
                              example: 42.0864678279902
                              description: >-
                                30-day realized volatility for the first pair
                                using Parkinson method
                            realizedVolatility90One:
                              type: number
                              example: 57.68190160816796
                              description: >-
                                90-day realized volatility for the first pair
                                using Parkinson method
                            realizedVolatility180One:
                              type: number
                              example: 57.19054161014279
                              description: >-
                                180-day realized volatility for the first pair
                                using Parkinson method
                            pairTwo:
                              type: string
                              example: bat_usd
                              description: The second trading pair identifier
                            closeTwo:
                              type: number
                              example: 0.21888
                              description: The closing price for the second pair
                            returnTwo:
                              type: number
                              example: 0.028499878450170477
                              description: The return for the second pair
                            realizedVolatility30Two:
                              type: number
                              example: 68.5370023337145
                              description: >-
                                30-day realized volatility for the second pair
                                using Parkinson method
                            realizedVolatility90Two:
                              type: number
                              example: 98.47758869601947
                              description: >-
                                90-day realized volatility for the second pair
                                using Parkinson method
                            realizedVolatility180Two:
                              type: number
                              example: 98.80410983128807
                              description: >-
                                180-day realized volatility for the second pair
                                using Parkinson method
                            correlation30:
                              type: number
                              example: 0.7552476390292794
                              description: 30-day rolling correlation between the two pairs
                            correlation90:
                              type: number
                              example: 0.799399139913421
                              description: 90-day rolling correlation between the two pairs
                            correlation180:
                              type: number
                              example: 0.7034835781804859
                              description: >-
                                180-day rolling correlation between the two
                                pairs
                            beta30:
                              type: number
                              example: 3.2189444686705147e-7
                              description: >-
                                30-day beta of the second pair relative to the
                                first pair
                            beta90:
                              type: number
                              example: 3.259995070131424e-7
                              description: >-
                                90-day beta of the second pair relative to the
                                first pair
                            beta180:
                              type: number
                              example: 2.587090631033647e-7
                              description: >-
                                180-day beta of the second pair relative to the
                                first pair
              examples:
                Result:
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      data:
                        - timestamp: 1717891200000
                          pairOne: btc_usd
                          closeOne: 69637.87
                          returnOne: 0.004805182515383674
                          realizedVolatility30One: 42.0864678279902
                          realizedVolatility90One: 57.68190160816796
                          realizedVolatility180One: 57.19054161014279
                          pairTwo: bat_usd
                          closeTwo: 0.21888
                          returnTwo: 0.028499878450170477
                          realizedVolatility30Two: 68.5370023337145
                          realizedVolatility90Two: 98.47758869601947
                          realizedVolatility180Two: 98.80410983128807
                          correlation30: 0.7552476390292794
                          correlation90: 0.799399139913421
                          correlation180: 0.7034835781804859
                          beta30: 3.2189444686705147e-7
                          beta90: 3.259995070131424e-7
                          beta180: 2.587090631033647e-7
                        - timestamp: 1717804800000
                          pairOne: btc_usd
                          closeOne: 69304.05
                          returnOne: -0.0002954657711849934
                          realizedVolatility30One: 43.510440478954465
                          realizedVolatility90One: 58.54203426168267
                          realizedVolatility180One: 57.26235339834626
                          pairTwo: bat_usd
                          closeTwo: 0.21273
                          returnTwo: -0.07085578364699298
                          realizedVolatility30Two: 69.60916551937758
                          realizedVolatility90Two: 100.10234014263939
                          realizedVolatility180Two: 98.80989210134847
                          correlation30: 0.7809324038016613
                          correlation90: 0.8040191980294766
                          correlation180: 0.7039716058761781
                          beta30: 3.298003756654707e-7
                          beta90: 3.2338597625240846e-7
                          beta180: 2.580752678941824e-7
                        - timestamp: 1717718400000
                          pairOne: btc_usd
                          closeOne: 69324.53
                          returnOne: -0.020687803170697266
                          realizedVolatility30One: 44.52510585826129
                          realizedVolatility90One: 58.620168182085145
                          realizedVolatility180One: 57.74446769789986
                          pairTwo: bat_usd
                          closeTwo: 0.22835
                          returnTwo: -0.0702970349285314
                          realizedVolatility30Two: 67.59168422916571
                          realizedVolatility90Two: 99.79452179567559
                          realizedVolatility180Two: 99.14883650740931
                          correlation30: 0.8384256395875948
                          correlation90: 0.8123615147733092
                          correlation180: 0.7156438865064703
                          beta30: 3.213416176062202e-7
                          beta90: 3.222167701111019e-7
                          beta180: 2.6232794407298634e-7
                        - timestamp: 1717632000000
                          pairOne: btc_usd
                          closeOne: 70773.64
                          returnOne: -0.004897583519386445
                          realizedVolatility30One: 43.7653513827422
                          realizedVolatility90One: 58.28780588209326
                          realizedVolatility180One: 57.57807390771005
                          pairTwo: bat_usd
                          closeTwo: 0.24498
                          returnTwo: -0.01844264842333594
                          realizedVolatility30Two: 57.788771231287726
                          realizedVolatility90Two: 99.19624699849902
                          realizedVolatility180Two: 98.43878948353606
                          correlation30: 0.8347486153111778
                          correlation90: 0.8048882724001079
                          correlation180: 0.7150263754113316
                          beta30: 2.9859210171738087e-7
                          beta90: 3.2187101162116015e-7
                          beta180: 2.611012411634596e-7
                        - timestamp: 1717545600000
                          pairOne: btc_usd
                          closeOne: 71121.11
                          returnOne: 0.008171385099943545
                          realizedVolatility30One: 44.10671312259362
                          realizedVolatility90One: 58.66730021945763
                          realizedVolatility180One: 57.56836799053604
                          pairTwo: bat_usd
                          closeTwo: 0.24954
                          returnTwo: 0.024461213541681317
                          realizedVolatility30Two: 57.667903155340795
                          realizedVolatility90Two: 99.74604119536528
                          realizedVolatility180Two: 98.47441035636534
                          correlation30: 0.8340454699445516
                          correlation90: 0.7975124608841659
                          correlation180: 0.7145197980406409
                          beta30: 2.9348839866265736e-7
                          beta90: 3.158520069930095e-7
                          beta180: 2.6096796522584775e-7
                        - timestamp: 1717459200000
                          pairOne: btc_usd
                          closeOne: 70542.32
                          returnOne: 0.025139890979064928
                          realizedVolatility30One: 44.85597488724197
                          realizedVolatility90One: 58.789640030384824
                          realizedVolatility180One: 57.63359881131043
                          pairTwo: bat_usd
                          closeTwo: 0.24351
                          returnTwo: 0.0036203602303056456
                          realizedVolatility30Two: 58.17214054961427
                          realizedVolatility90Two: 100.52944674495889
                          realizedVolatility180Two: 98.53728013004222
                          correlation30: 0.8431772514802272
                          correlation90: 0.7915534454453563
                          correlation180: 0.7153903152429061
                          beta30: 2.893332386492286e-7
                          beta90: 3.1673458881810907e-7
                          beta180: 2.6138032641376585e-7
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````