> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Backtest a Tilt

> Backtest a saved Tilt methodology over a date range.

The backtest uses the Tilt's saved methodology. Set `MONTHLY`, `QUARTERLY`,
`SEMI_ANNUALLY`, or `ANNUALLY` in `rules.rebalancing_period` when you
[apply construction](/api-reference/index-construction-preview/apply-construction).
The date parameters select the analysis window; they do not change the cadence.

Add `benchmark` for benchmark returns, relative performance, and risk
statistics. Omit it for a portfolio-only result.


## OpenAPI

````yaml api-reference/index-construction-preview-openapi.yaml GET /api/v1/tilts/{tilt_uuid}/backtest
openapi: 3.1.0
info:
  title: 'Tilt Index Construction API: Design Preview'
  version: 0.4.0-design-preview
  summary: >-
    A restrained public projection of Tilt's existing index construction
    workflow.
  description: |
    A Tilt is a persistent project for one index methodology. Its construction
    rules are the source, evaluated constituent snapshots are the build
    artifacts, and methodology history is version history. This bounded
    repository analogy does not imply branches, forks, merges, or cloning.

    This contract covers rules-based equity construction only. Applying
    construction saves the rules, evaluates them, and commits the complete
    weighted constituent snapshot atomically.
servers:
  - url: https://x.invalid
    description: Non-routable design preview
security:
  - ApiKey: []
tags:
  - name: Tilts
    description: Organization-owned Tilt projects and versions.
  - name: Construction
    description: Apply methodology and read its saved weighted evaluation.
  - name: Catalog
    description: >-
      Discover fields, functions, universes, and classifications used in
      expressions.
  - name: Tickers
    description: Resolve security identifiers to exact Tilt asset IDs.
  - name: Backtests
    description: Backtest a saved Tilt using its configured rebalance behavior.
paths:
  /api/v1/tilts/{tilt_uuid}/backtest:
    parameters:
      - $ref: '#/components/parameters/TiltUuid'
    get:
      tags:
        - Backtests
      summary: Backtest a Tilt
      description: |
        Computes a backtest synchronously using the saved methodology. A Tilt
        with a `rules.rebalancing_period` uses point-in-time reconstitution at
        that cadence. A Tilt without one uses a fixed-share basket based on its
        saved snapshot.

        Cadence is not a run parameter. To compare monthly and quarterly
        methodologies, save each cadence through construction apply and
        backtest the UUID returned for each version. `start_date` and `end_date`
        change the analysis window, not the rebalance schedule.
      operationId: backtestTilt
      parameters:
        - name: start_date
          in: query
          schema:
            type: string
            format: date
          description: Start date. Defaults to 365 days before today.
        - name: end_date
          in: query
          schema:
            type: string
            format: date
          description: End date. Defaults to today.
        - name: benchmark
          in: query
          schema:
            type: string
            minLength: 1
          description: |
            Optional benchmark ticker or supported canonical identifier, such
            as `SPY`. When supplied, the response includes benchmark returns,
            comparable period returns, and risk statistics. Omit for the
            portfolio-only response.
      responses:
        '200':
          description: >-
            Backtest levels, returns, scheduled membership changes, and optional
            benchmark analysis.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Backtest'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '504':
          description: The synchronous backtest timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    TiltUuid:
      name: tilt_uuid
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Backtest:
      type: object
      required:
        - tilt
      properties:
        tilt:
          type: object
          required:
            - backtest_returns
            - backtest_values
          properties:
            since_inception_returns:
              type: string
            backtest_returns:
              type: object
              additionalProperties:
                type: string
              description: Daily returns keyed by ISO date.
            backtest_values:
              type: object
              additionalProperties:
                type: string
              description: Index levels keyed by ISO date.
            cumulative_backtest_returns:
              type: object
              additionalProperties:
                type: string
        benchmark:
          $ref: '#/components/schemas/BenchmarkBacktest'
        summary:
          $ref: '#/components/schemas/BacktestSummary'
        rebalance_events:
          type: array
          description: >-
            Scheduled membership changes, not a complete realized transaction
            history.
          items:
            $ref: '#/components/schemas/RebalanceEvent'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    BenchmarkBacktest:
      type: object
      additionalProperties: false
      required:
        - identifier
        - backtest_returns
      description: Present only when the request includes `benchmark`.
      properties:
        identifier:
          type: string
          description: Resolved canonical benchmark identity.
        backtest_returns:
          type: object
          additionalProperties:
            type: string
          description: Decimal-fraction daily returns keyed by ISO date.
    BacktestSummary:
      type: object
      additionalProperties: false
      required:
        - portfolio_return
        - benchmark_return
        - risk_metrics
      description: Present only when the request includes `benchmark`.
      properties:
        portfolio_return:
          type: number
          description: >-
            Portfolio return over the requested period in percentage points;
            12.5 means 12.5%.
        benchmark_return:
          type: number
          description: >-
            Benchmark return over its available period in percentage points; 10
            means 10%.
        relative_return:
          type: number
          description: >
            Portfolio return minus benchmark return in percentage points.
            Omitted

            when the portfolio and benchmark coverage windows do not match.
        risk_metrics:
          $ref: '#/components/schemas/BacktestRiskMetrics'
        benchmark_coverage_note:
          type: string
          description: Explains a shorter benchmark coverage window when applicable.
    RebalanceEvent:
      type: object
      required:
        - date
        - added
        - removed
        - constituent_count
      properties:
        date:
          type: string
          format: date
        added:
          type: array
          items:
            $ref: '#/components/schemas/BacktestTicker'
        removed:
          type: array
          items:
            $ref: '#/components/schemas/BacktestTicker'
        constituent_count:
          type: integer
    BacktestRiskMetrics:
      type: object
      additionalProperties: false
      description: |
        Statistics calculated from daily returns. Volatility is annualized over
        252 trading days; Sharpe uses a 4% annual risk-free rate. Unavailable
        statistics are omitted.
      properties:
        beta:
          type: number
        sharpe:
          type: number
        volatility:
          type: number
          description: Annualized decimal fraction; 0.18 means 18%.
        max_drawdown:
          type: number
          description: Decimal fraction; 0.12 means a 12% maximum drawdown.
    BacktestTicker:
      type: object
      required:
        - symbol
      properties:
        symbol:
          type: string
        tilt_asset_id:
          type:
            - string
            - 'null'
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The Tilt was not found in the API key's organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key

````