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

# Minimum Variance Portfolio

> Constructs the minimum variance portfolio (MVP) that minimizes portfolio volatility without regard to expected returns. This is the leftmost point on the efficient frontier and represents the portfolio with the lowest possible risk.

**Use Cases:**
- Conservative portfolio construction for risk-averse investors
- Benchmark for evaluating other portfolio strategies
- Downside protection during market uncertainty
- Foundation for long-only constrained optimization

**Mathematical Background:**
Minimizes: w^T Σ w
Subject to: Σw_i = 1, and optional min/max weight constraints

Where w is the weight vector and Σ is the covariance matrix.

**Credits:** 5 per request [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/portfolio.json post /quantlib/portfolio/optimize/min-variance
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Portfolio
  description: >-
    Portfolio optimization and risk management module for institutional-grade
    portfolio construction, analysis, and monitoring. Includes mean-variance
    optimization, Black-Litterman, risk parity, and comprehensive risk metrics.


    **Tier:** Pro (5 credits per request)


    **Key Features:**

    - Mean-variance optimization (minimum variance, maximum Sharpe, target
    return)

    - Efficient frontier construction with tangency portfolio identification

    - Black-Litterman model for Bayesian view incorporation

    - Risk parity strategies (ERC, HRP, inverse volatility)

    - Comprehensive risk metrics (VaR, CVaR, tracking error, information ratio)

    - Advanced portfolio analytics (risk contribution, drawdown,
    diversification)
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-portfolio
    description: Portfolio optimization and risk management endpoints
    x-displayName: Portfolio
paths:
  /quantlib/portfolio/optimize/min-variance:
    post:
      tags:
        - quantlib-portfolio
      summary: Minimum Variance Portfolio
      description: >-
        Constructs the minimum variance portfolio (MVP) that minimizes portfolio
        volatility without regard to expected returns. This is the leftmost
        point on the efficient frontier and represents the portfolio with the
        lowest possible risk.


        **Use Cases:**

        - Conservative portfolio construction for risk-averse investors

        - Benchmark for evaluating other portfolio strategies

        - Downside protection during market uncertainty

        - Foundation for long-only constrained optimization


        **Mathematical Background:**

        Minimizes: w^T Σ w

        Subject to: Σw_i = 1, and optional min/max weight constraints


        Where w is the weight vector and Σ is the covariance matrix.


        **Credits:** 5 per request [Tier: PRO, Credits: 5]
      operationId: min_variance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - expected_returns
                - covariance_matrix
              properties:
                expected_returns:
                  type: array
                  items:
                    type: number
                  description: Expected returns for each asset (annualized)
                  example:
                    - 0.08
                    - 0.12
                    - 0.1
                    - 0.15
                covariance_matrix:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
                  description: >-
                    Asset covariance matrix (annualized). Must be symmetric and
                    positive semi-definite.
                  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
                rf_rate:
                  type: number
                  description: >-
                    Risk-free rate (annualized). Used for Sharpe ratio
                    calculation.
                  default: 0
                  example: 0.03
                min_weights:
                  type: array
                  items:
                    type: number
                  description: >-
                    Minimum weight constraints for each asset (e.g., 0.0 for
                    long-only)
                  nullable: true
                  example:
                    - 0
                    - 0
                    - 0
                    - 0
                max_weights:
                  type: array
                  items:
                    type: number
                  description: >-
                    Maximum weight constraints for each asset (e.g., 0.3 for 30%
                    position limit)
                  nullable: true
                  example:
                    - 0.4
                    - 0.4
                    - 0.4
                    - 0.4
      responses:
        '200':
          description: Minimum variance portfolio successfully optimized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      weights:
                        type: array
                        items:
                          type: number
                        description: Optimal portfolio weights (sum to 1.0)
                        example:
                          - 0.45
                          - 0.2
                          - 0.25
                          - 0.1
                      expected_return:
                        type: number
                        description: Expected portfolio return (annualized)
                        example: 0.1025
                      volatility:
                        type: number
                        description: Portfolio volatility/standard deviation (annualized)
                        example: 0.1834
                      sharpe_ratio:
                        type: number
                        description: Sharpe ratio (return - rf_rate) / volatility
                        example: 0.3956
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientCreditsError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientCreditsError:
      description: Insufficient API credits
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Insufficient credits. This endpoint requires 5 credits.
    ValidationError:
      description: Request validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
                  properties:
                    loc:
                      type: array
                      items:
                        type: string
                    msg:
                      type: string
                    type:
                      type: string
          example:
            detail:
              - loc:
                  - body
                  - expected_returns
                msg: field required
                type: value_error.missing
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````