OpenAPI Specification
openapi: 3.1.0
info:
title: DFlow Aggregator admin prediction_market API
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: prediction_market
description: Prediction market 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:
PredictionMarketInitBadRequestCode:
type: string
enum:
- invalid_payer
- invalid_outcome_mint
- prediction_market_already_initialized
- unknown_outcome_mint
PredictionMarketInitServiceUnavailableCode:
type: string
enum:
- not_ready
- lagging
PredictionMarketInitServiceUnavailableResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/PredictionMarketInitServiceUnavailableCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
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.'
PredictionMarketInitInternalServerErrorResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/PredictionMarketInitInternalServerErrorCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
PredictionMarketInitInternalServerErrorCode:
type: string
enum:
- failed_to_construct_transaction
PredictionMarketInitBadRequestResponse:
type: object
required:
- msg
- code
properties:
code:
$ref: '#/components/schemas/PredictionMarketInitBadRequestCode'
msg:
type: string
example:
code: <enum<string>>
msg: <string>
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.