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

# Calculate Asset Swap Spread

> Calculate the asset swap spread - the spread over LIBOR/SOFR that makes an asset swap structure (buying a bond and entering a fixed-for-floating swap) break-even. The ASW spread isolates the credit risk component by removing interest rate risk through the swap. It represents the pure credit spread and is widely used for relative value analysis, credit trading, and comparing bonds with different coupons and maturities. More accurate than nominal spread as it properly accounts for the term structure. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/solver.json post /quantlib/solver/finance/asw-spread
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Solver
  description: >-
    Solver module endpoints for FinceptQuantLib API. The Solver module (Basic
    Tier, 1 credit per request) provides advanced financial solvers including
    bond analytics (yield, duration, convexity), implied volatility
    calculations, spread computations (Z-spread, ASW, OAS), curve bootstrapping,
    interest rate conversions, and model calibration (Vasicek, CIR). Essential
    for fixed income analysis, derivatives pricing, and risk management.
  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-solver
    description: >-
      Advanced financial solvers for bond analytics, implied volatility, spread
      calculations, and model calibration
    x-displayName: Solver
paths:
  /quantlib/solver/finance/asw-spread:
    post:
      tags:
        - quantlib-solver
      summary: Calculate Asset Swap Spread
      description: >-
        Calculate the asset swap spread - the spread over LIBOR/SOFR that makes
        an asset swap structure (buying a bond and entering a fixed-for-floating
        swap) break-even. The ASW spread isolates the credit risk component by
        removing interest rate risk through the swap. It represents the pure
        credit spread and is widely used for relative value analysis, credit
        trading, and comparing bonds with different coupons and maturities. More
        accurate than nominal spread as it properly accounts for the term
        structure. [Tier: PRO, Credits: 5]
      operationId: asw_spread
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - bond_price
                - coupon
                - maturity
                - base_rates
                - base_times
              properties:
                bond_price:
                  type: number
                  description: Current market price of the bond
                  example: 98
                face:
                  type: number
                  description: Face value of the bond
                  default: 100
                  example: 100
                coupon:
                  type: number
                  description: Annual coupon rate as a decimal
                  example: 0.05
                maturity:
                  type: number
                  description: Time to maturity in years
                  example: 5
                frequency:
                  type: integer
                  description: Coupon payment frequency per year
                  default: 2
                  enum:
                    - 1
                    - 2
                    - 4
                    - 12
                  example: 2
                base_rates:
                  type: array
                  description: Array of zero rates for the discount curve
                  items:
                    type: number
                  example:
                    - 0.03
                    - 0.032
                    - 0.034
                    - 0.036
                    - 0.038
                    - 0.04
                base_times:
                  type: array
                  description: Array of times for the discount curve in years
                  items:
                    type: number
                  example:
                    - 0.5
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
            example:
              bond_price: 98
              face: 100
              coupon: 0.05
              maturity: 5
              frequency: 2
              base_rates:
                - 0.03
                - 0.032
                - 0.034
                - 0.036
                - 0.038
                - 0.04
              base_times:
                - 0.5
                - 1
                - 2
                - 3
                - 4
                - 5
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      asw_spread:
                        type: number
                        description: >-
                          The asset swap spread as a decimal (multiply by 10000
                          for basis points)
                        example: 0.0145
              example:
                success: true
                data:
                  asw_spread: 0.0145
        '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
      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

````