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

# Margrabe Exchange Option Price

> Price an exchange option using Margrabe's formula. An exchange option gives the right to exchange one asset for another: payoff = max(S1 - S2, 0) for a call.

**Special Case:** When strike K = 0, a spread option becomes a Margrabe exchange option.

**Use Cases:**
- Price options to exchange one asset for another
- Value executive stock options (exchange labor for stock)
- Price merger arbitrage options
- Value switching options (switch between two production modes)
- Real options analysis (technology switching, fuel switching)

**Note:** Returns both call and put prices (option to exchange S1 for S2, and vice versa).

**Tier:** Standard (2 credits/request) [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/pricing.json post /quantlib/pricing/margrabe
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Pricing Module
  description: >-
    Advanced options pricing models including Black-Scholes, Black76, Bachelier,
    Kirk spread options, and binomial trees. Standard Tier access required (2
    credits per request).
  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-pricing
    description: Advanced options pricing models and Greeks calculation
    x-displayName: Pricing
paths:
  /quantlib/pricing/margrabe:
    post:
      tags:
        - quantlib-pricing
      summary: Margrabe Exchange Option Price
      description: >-
        Price an exchange option using Margrabe's formula. An exchange option
        gives the right to exchange one asset for another: payoff = max(S1 - S2,
        0) for a call.


        **Special Case:** When strike K = 0, a spread option becomes a Margrabe
        exchange option.


        **Use Cases:**

        - Price options to exchange one asset for another

        - Value executive stock options (exchange labor for stock)

        - Price merger arbitrage options

        - Value switching options (switch between two production modes)

        - Real options analysis (technology switching, fuel switching)


        **Note:** Returns both call and put prices (option to exchange S1 for
        S2, and vice versa).


        **Tier:** Standard (2 credits/request) [Tier: PRO, Credits: 5]
      operationId: margrabe_price
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MargrabeRequest'
            example:
              S1: 105
              S2: 100
              q1: 0.02
              q2: 0.015
              sigma1: 0.3
              sigma2: 0.25
              rho: 0.6
              time_to_maturity: 1
      responses:
        '200':
          description: Successful calculation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      margrabe_call:
                        type: number
                        description: Price to exchange S2 for S1
                        example: 12.456
                      margrabe_put:
                        type: number
                        description: Price to exchange S1 for S2
                        example: 7.234
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientCreditsError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    MargrabeRequest:
      type: object
      required:
        - S1
        - S2
        - sigma1
        - sigma2
        - rho
        - time_to_maturity
      properties:
        S1:
          type: number
          description: Current price of first asset
          example: 105
        S2:
          type: number
          description: Current price of second asset
          example: 100
        q1:
          type: number
          description: Continuous dividend yield of first asset (decimal format)
          example: 0.02
          default: 0
        q2:
          type: number
          description: Continuous dividend yield of second asset (decimal format)
          example: 0.015
          default: 0
        sigma1:
          type: number
          description: Annualized volatility of first asset (decimal format)
          example: 0.3
        sigma2:
          type: number
          description: Annualized volatility of second asset (decimal format)
          example: 0.25
        rho:
          type: number
          description: Correlation between the two assets
          example: 0.6
        time_to_maturity:
          type: number
          description: Time to expiration in years
          example: 1
  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 costs 2 credits per
                  request.
    ValidationError:
      description: Request validation failed
      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

````