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

# Initialize Prediction Market

> API reference for GET /prediction-market-init



## OpenAPI

````yaml GET /prediction-market-init
openapi: 3.1.0
info:
  title: DFlow Aggregator
  description: DFlow Aggregator API
  license:
    name: BUSL-1.1
  version: 0.1.0
servers:
  - url: https://quote-api.dflow.net
security:
  - api_key: []
tags:
  - name: order
    description: Order API endpoints
  - name: swap
    description: Swap API endpoints
  - name: intent
    description: Intent trading endpoints
  - name: prediction_market
    description: Prediction market endpoints
  - name: venues
    description: Venue endpoints
  - name: tokens
    description: Token endpoints
paths:
  /prediction-market-init:
    get:
      tags:
        - prediction_market
      summary: Returns a transaction to initialize a prediction market idempotently
      operationId: prediction_market_init_handler
      parameters:
        - name: payer
          in: query
          description: Base58-encoded address of the payer
          required: true
          schema:
            type: string
        - name: outcomeMint
          in: query
          description: >-
            Base58-encoded mint address of either outcome mint for the market to
            be initialized
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Prediction market init response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionMarketInitResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionMarketInitBadRequestResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PredictionMarketInitInternalServerErrorResponse
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PredictionMarketInitServiceUnavailableResponse
components:
  schemas:
    PredictionMarketInitResponse:
      type: object
      required:
        - transaction
        - lastValidBlockHeight
        - computeUnitLimit
      properties:
        computeUnitLimit:
          type: integer
          format: int32
          description: Compute unit limit assigned to the transaction
          minimum: 0
        lastValidBlockHeight:
          type: integer
          format: int64
          description: >-
            The last block height at which the blockhash assigned to the
            transaction is valid. Useful to

            determine whether the transaction has expired.
          minimum: 0
        transaction:
          type: string
          description: >-
            Base64-encoded transaction to initialize the market for the
            requested outcome mint. The

            payer must sign before sending it to Solana.
    PredictionMarketInitBadRequestResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/PredictionMarketInitBadRequestCode'
        msg:
          type: string
      example:
        code: <enum<string>>
        msg: <string>
    PredictionMarketInitInternalServerErrorResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/PredictionMarketInitInternalServerErrorCode'
        msg:
          type: string
      example:
        code: <enum<string>>
        msg: <string>
    PredictionMarketInitServiceUnavailableResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/PredictionMarketInitServiceUnavailableCode'
        msg:
          type: string
      example:
        code: <enum<string>>
        msg: <string>
    PredictionMarketInitBadRequestCode:
      type: string
      enum:
        - invalid_payer
        - invalid_outcome_mint
        - prediction_market_already_initialized
        - unknown_outcome_mint
    PredictionMarketInitInternalServerErrorCode:
      type: string
      enum:
        - failed_to_construct_transaction
    PredictionMarketInitServiceUnavailableCode:
      type: string
      enum:
        - not_ready
        - lagging
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Contact hello@dflow.net to obtain an API
        key.

````