> ## 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.

# Credit Valuation Adjustment (CVA)

> Calculates the Credit Valuation Adjustment - the market value of counterparty credit risk. CVA represents the expected loss from counterparty default on OTC derivatives. Includes Expected Positive Exposure (EPE) profile calculation. Required under Basel III and IFRS 13 for marking derivative books to market. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/risk.json post /quantlib/risk/xva/cva
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Risk Module
  description: >-
    Professional-grade risk management endpoints including Value at Risk (VaR),
    stress testing, copulas, extreme value theory (EVT), XVA calculations,
    sensitivities, and portfolio hedging. Part of the Pro Tier (5 credits per
    request).
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
    email: support@fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-risk
    description: Risk Management Module - Pro Tier (5 credits/request)
    x-displayName: Risk
paths:
  /quantlib/risk/xva/cva:
    post:
      tags:
        - quantlib-risk
      summary: Credit Valuation Adjustment (CVA)
      description: >-
        Calculates the Credit Valuation Adjustment - the market value of
        counterparty credit risk. CVA represents the expected loss from
        counterparty default on OTC derivatives. Includes Expected Positive
        Exposure (EPE) profile calculation. Required under Basel III and IFRS 13
        for marking derivative books to market. [Tier: PRO, Credits: 5]
      operationId: xva_cva
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - exposure_paths
                - counterparty_spread
              properties:
                exposure_paths:
                  type: array
                  description: >-
                    Simulated exposure paths (each path is array of exposures
                    over time)
                  items:
                    type: array
                    items:
                      type: number
                  example:
                    - - 100000
                      - 105000
                      - 98000
                    - - 100000
                      - 102000
                      - 107000
                counterparty_spread:
                  type: number
                  description: Counterparty credit spread in basis points
                  example: 250
                  minimum: 0
                recovery_rate:
                  type: number
                  description: Recovery rate on counterparty default (0 to 1)
                  example: 0.4
                  default: 0.4
                  minimum: 0
                  maximum: 1
                own_spread:
                  type: number
                  description: Own credit spread in basis points (for DVA calculation)
                  example: 150
                  nullable: true
                own_recovery:
                  type: number
                  description: Own recovery rate
                  example: 0.4
                  default: 0.4
                funding_spread:
                  type: number
                  description: Funding spread in basis points (for FVA)
                  example: 80
                  nullable: true
                time_points:
                  type: array
                  description: Time points in years corresponding to exposure paths
                  items:
                    type: number
                  example:
                    - 0
                    - 0.5
                    - 1
                    - 1.5
                    - 2
                  nullable: true
            example:
              exposure_paths:
                - - 100000
                  - 120000
                  - 135000
                  - 128000
                  - 140000
                - - 100000
                  - 95000
                  - 110000
                  - 125000
                  - 130000
                - - 100000
                  - 105000
                  - 98000
                  - 115000
                  - 122000
              counterparty_spread: 300
              recovery_rate: 0.35
              time_points:
                - 0
                - 0.25
                - 0.5
                - 0.75
                - 1
      responses:
        '200':
          description: CVA calculation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      cva:
                        type: number
                        description: Credit Valuation Adjustment
                        example: 3250.75
                      epe_profile:
                        type: array
                        description: Expected Positive Exposure profile over time
                        items:
                          type: number
                        example:
                          - 100000
                          - 106667
                          - 114333
                          - 122667
                          - 130667
              example:
                success: true
                data:
                  cva: 3250.75
                  epe_profile:
                    - 100000
                    - 106667
                    - 114333
                    - 122667
                    - 130667
        '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 for this request
      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
  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

````