---
title: "Sharpe Ratio"
method: POST
path: "/portfolios/analysis/mean-variance/sharpe-ratio"
tags: ["Portfolio Analysis / Mean-Variance"]
---

# Sharpe Ratio

`POST /portfolios/analysis/mean-variance/sharpe-ratio`

## Request

- Base URL: `https://api.portfoliooptimizer.io/v1`
- URL: `https://api.portfoliooptimizer.io/v1/portfolios/analysis/mean-variance/sharpe-ratio`
- Auth: API key in header `X-API-Key`

Compute the Sharpe ratio, as well as its 95% confidence interval when applicable, of a portfolio.

References
* Harry M. Markowitz, Portfolio Selection, Efficient Diversification of Investments, Second edition, Blackwell Publishers Inc.
* [Sharpe, W. (1994) The Sharpe Ratio. Journal of Portfolio Management, 21, 49-58](https://www.pm-research.com/content/iijpormgmt/21/1/49)
* [Lopez de Prado, Marcos and Lipton, Alexander and Zoonekynd, Vincent, How to Use the Sharpe Ratio](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5520741)

## Request body

- union
  - object
    - `assets` integer, required: The number of assets
    - `assetsReturns` number[], required: assetsReturns[i] is the arithmetic return of the asset i over the considered time period
    - `assetsCovarianceMatrix` array[], required: assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns over the considered time period
      - number[]
    - `riskFreeReturn` number: The constant risk-free arithmetic return over the considered time period, in percentage
    - `portfolios` object[], required
      - `assetsWeights` number[], required: assetsWeights[i] is the weight of the asset i in the portfolio over the considered time period, in percentage
  - object
    - `riskFreeReturn` number: The constant risk-free arithmetic return over the considered time period, in percentage; exclusive with riskFreeReturns
    - `riskFreeReturns` number[]: riskFreeReturns[t] is the risk-free arithmetic return at the time t; the riskFreeReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with riskFreeReturn
    - `portfolios` object[], required
      - `portfolioReturns` number[]: portfolioReturns[t] is the arithmetic return of the portfolio at the time t; exclusive with portfolioValues
      - `portfolioValues` number[]: portfolioValues[t] is the value of the portfolio at the time t; exclusive with portfolioReturns

## Response `200`

OK

- object
  - `portfolios` object[], required
    - `portfolioSharpeRatio` number, required: The Sharpe Ratio of the portfolio
    - `portfolioSharpeRatioConfidenceIntervalLowerBound` number: The lower bound of the 95% confidence interval for the portfolio Sharpe Ratio; only available when the portfolio Sharpe Ratio is computed with portfolio values or returns
    - `portfolioSharpeRatioConfidenceIntervalUpperBound` number: The upper bound of the 95% confidence interval for the portfolio Sharpe Ratio; only available when the portfolio Sharpe Ratio is computed with portfolio values or returns

## Changes

- **2026-08-30** `d89d19b63b5d`: 2 info
  - added the optional property `portfolios/items/portfolioSharpeRatioConfidenceIntervalLowerBound` to the response with the `200` status
  - added the optional property `portfolios/items/portfolioSharpeRatioConfidenceIntervalUpperBound` to the response with the `200` status
- **2026-06-08** `614076795988`: 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `oneOf` list
  - added `subschema #1, subschema #2` to the request body `oneOf` list
- **2026-04-03** `24e65d80f8eb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/changes/portfolios/analysis/mean-variance/sharpe-ratio/post.md)

---

[API](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer.md) - [All operations](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) - [OpenAPI document](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/revisions/9d075aa717bf?raw)
