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

# Certainty Equivalent

> Calculate the certainty equivalent (CE) of a risky lottery: the guaranteed amount that yields the same utility as the risky prospect. CE solves U(CE) = E[U(X)] where X is the random outcome. For risk-averse individuals, CE < E[X] (expected value). The difference E[X] - CE is the risk premium. Returns the certain wealth equivalent to the lottery. Use for valuing risky assets and insurance. [Tier: STANDARD, Credits: 2]



## OpenAPI

````yaml api-specs/economics.json post /quantlib/economics/utility/certainty-equivalent
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Economics
  description: >-
    Economics module endpoints for FinceptQuantLib API - general equilibrium,
    game theory, auctions, and utility functions
  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-economics
    description: >-
      Economics module - general equilibrium, game theory, auctions, and utility
      theory
    x-displayName: Economics
paths:
  /quantlib/economics/utility/certainty-equivalent:
    post:
      tags:
        - quantlib-economics
      summary: Certainty Equivalent
      description: >-
        Calculate the certainty equivalent (CE) of a risky lottery: the
        guaranteed amount that yields the same utility as the risky prospect. CE
        solves U(CE) = E[U(X)] where X is the random outcome. For risk-averse
        individuals, CE < E[X] (expected value). The difference E[X] - CE is the
        risk premium. Returns the certain wealth equivalent to the lottery. Use
        for valuing risky assets and insurance. [Tier: STANDARD, Credits: 2]
      operationId: >-
        certainty_equivalent_quantlib_economics_utility_certainty_equivalent_post
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - utility_type
                - outcomes
              properties:
                utility_type:
                  type: string
                  description: Type of utility function to use
                  enum:
                    - cara
                    - crra
                    - log
                  example: crra
                param:
                  type: number
                  description: >-
                    Utility function parameter (risk_aversion for CARA, gamma
                    for CRRA, unused for log)
                  example: 2
                  nullable: true
                outcomes:
                  type: array
                  description: Possible wealth outcomes
                  items:
                    type: number
                  minItems: 1
                  example:
                    - 8000
                    - 12000
                probabilities:
                  type: array
                  description: >-
                    Probabilities for each outcome (must sum to 1, if null uses
                    uniform)
                  items:
                    type: number
                    minimum: 0
                    maximum: 1
                  example:
                    - 0.5
                    - 0.5
                  nullable: true
            example:
              utility_type: crra
              param: 2
              outcomes:
                - 8000
                - 12000
              probabilities:
                - 0.5
                - 0.5
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      certainty_equivalent:
                        type: number
                        description: >-
                          Certain amount equivalent to the risky lottery (CE <
                          E[X] for risk aversion)
                        example: 9798
              example:
                success: true
                data:
                  certainty_equivalent: 9798
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
              example:
                detail:
                  - loc:
                      - body
                      - outcomes
                    msg: ensure this value has at least 1 items
                    type: value_error.list.min_items
      security:
        - APIKeyHeader: []
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientTierError:
      description: API tier insufficient for this endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Endpoint requires Basic tier or higher
  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

````