> ## Documentation index
> Fetch the complete documentation index at: https://docs.simplycpf.com/llms.txt
> Ask it with GET https://docs.simplycpf.com/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Compare investment scenarios

> Compare multiple investment scenarios with different interest rates.

`POST /investment-comparison`

## OpenAPI

````yaml openapi.json post /investment-comparison
openapi: 3.1.0
info:
  title: SimplyCPF API
  version: 1.0.0
  description: "Public SimplyCPF calculation and reference API. No authentication
    required. Amounts are in SGD. Rate limit: 10 requests per 10 seconds per
    client IP. Results are estimates, not financial advice."
  contact:
    name: SimplyCPF
    url: https://simplycpf.com
servers:
  - url: https://simplycpf.com/api/cpf
    description: Production
  - url: http://localhost:3000/api/cpf
    description: Local development
security: []
tags:
  - name: Calculation
    description: Calculate CPF contributions and projections
  - name: Age Groups
    description: Age group information and lookups
  - name: Income Ceiling
    description: CPF income ceiling data
  - name: Interest Rates
    description: CPF interest rates and SGS yields
  - name: Investment
    description: Investment comparison tools
paths:
  /investment-comparison:
    post:
      operationId: compareInvestments
      summary: Compare investment scenarios
      description: Compare multiple investment scenarios with different interest rates.
      tags:
        - Investment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvestmentComparisonRequest"
            example:
              principal: 100000
              years: 10
              scenarios:
                - name: CPF OA
                  rate: 2.5
                - name: CPF SA
                  rate: 4
                - name: Market
                  rate: 7
      responses:
        "200":
          description: Investment comparison results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvestmentComparisonResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          $ref: "#/components/responses/RateLimited"
components:
  responses:
    RateLimited:
      description: Rate limit exceeded. Production CPF API endpoints allow 10 requests
        per 10 seconds per client IP.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Rate limit exceeded
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    InvestmentScenario:
      type: object
      properties:
        name:
          type: string
          description: Scenario name
        rate:
          type: number
          description: Annual interest rate percentage
      required:
        - name
        - rate
    InvestmentComparisonRequest:
      type: object
      properties:
        principal:
          type: number
          minimum: 0
          description: Initial principal amount
        years:
          type: integer
          minimum: 1
          maximum: 50
          description: Investment duration in years (1-50)
        scenarios:
          type: array
          minItems: 1
          maxItems: 10
          items:
            $ref: "#/components/schemas/InvestmentScenario"
          description: Investment scenarios to compare (1-10)
      required:
        - principal
        - years
        - scenarios
    InvestmentScenarioResult:
      type: object
      properties:
        name:
          type: string
          description: Scenario name
        rate:
          type: number
          description: Annual interest rate used
        finalValue:
          type: number
          description: Final investment value
        totalGrowth:
          type: number
          description: Total growth amount
        growthPercentage:
          type: number
          description: Growth as percentage of principal
      required:
        - name
        - rate
        - finalValue
        - totalGrowth
        - growthPercentage
    InvestmentComparisonResponse:
      type: object
      properties:
        input:
          type: object
          properties:
            principal:
              type: number
            years:
              type: number
          required:
            - principal
            - years
        results:
          type: array
          items:
            $ref: "#/components/schemas/InvestmentScenarioResult"
      required:
        - input
        - results
````
