Skip to main content
POST
/
quantlib
/
portfolio
/
optimize
/
efficient-frontier
Efficient Frontier
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/portfolio/optimize/efficient-frontier \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "expected_returns": [
    0.08,
    0.12,
    0.1,
    0.15
  ],
  "covariance_matrix": [
    [
      0.04,
      0.006,
      0.008,
      0.01
    ],
    [
      0.006,
      0.09,
      0.012,
      0.015
    ],
    [
      0.008,
      0.012,
      0.0625,
      0.018
    ],
    [
      0.01,
      0.015,
      0.018,
      0.16
    ]
  ],
  "n_points": 50
}
'
{
  "success": true,
  "data": {
    "frontier": [
      {
        "expected_return": 0.1,
        "volatility": 0.1856,
        "sharpe_ratio": 0.3772,
        "weights": [
          0.4,
          0.25,
          0.25,
          0.1
        ]
      }
    ],
    "n_points": 50
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
expected_returns
number[]
required

Expected returns for each asset (annualized)

Example:
[0.08, 0.12, 0.1, 0.15]
covariance_matrix
number[][]
required

Asset covariance matrix (annualized)

Example:
[
[0.04, 0.006, 0.008, 0.01],
[0.006, 0.09, 0.012, 0.015],
[0.008, 0.012, 0.0625, 0.018],
[0.01, 0.015, 0.018, 0.16]
]
n_points
integer
default:50

Number of portfolios to compute along the frontier. Higher values give smoother curves.

Required range: 10 <= x <= 200
Example:

50

Response

Efficient frontier successfully computed

success
boolean
Example:

true

data
object