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

# Submit Intent Swap

> API reference for POST /submit-intent

<Note>
  Most builders use [`GET /order`](/resources/trading-api/order/order), which returns a fully constructed transaction in one call. `POST /submit-intent` is the second step of the opt-in intent flow for builders who need stronger sandwich resistance on standard SPL pairs: pair it with [`GET /intent`](/resources/trading-api/declarative/quote). Token-2022 mints (including Kalshi outcome tokens) are not supported on this flow; use [`GET /order`](/resources/trading-api/order/order) for those.
</Note>


## OpenAPI

````yaml POST /submit-intent
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:
  /submit-intent:
    post:
      tags:
        - intent
      summary: Submits a declarative swap transaction for processing
      operationId: submit_intent_handler
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntentSwapRequest'
        required: true
      responses:
        '200':
          description: Declarative swap submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntentSwapResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitIntentBadRequestResponse'
components:
  schemas:
    IntentSwapRequest:
      type: object
      required:
        - quoteResponse
        - signedOpenTransaction
      properties:
        quoteResponse:
          $ref: '#/components/schemas/IntentQuoteResponse'
          description: The response from the quote endpoint
        signedOpenTransaction:
          type: string
          description: Base64-encoded intent opening transaction, signed by the user
    IntentSwapResponse:
      type: object
      required:
        - programId
        - orderAddress
        - openTransactionSignature
      properties:
        openTransactionSignature:
          type: string
          description: Base58-encoded open transaction signature
        orderAddress:
          type: string
          description: Base58-encoded order address
        programId:
          type: string
          description: Base58-encoded program ID of the program that facilitates the swap
    SubmitIntentBadRequestResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/SubmitIntentBadRequestCode'
        msg:
          type: string
      example:
        code: <enum<string>>
        msg: <string>
    IntentQuoteResponse:
      type: object
      required:
        - inputMint
        - inAmount
        - outputMint
        - outAmount
        - otherAmountThreshold
        - minOutAmount
        - slippageBps
        - feeBudget
        - priceImpactPct
      properties:
        expiry:
          $ref: '#/components/schemas/IntentExpiry'
          description: >-
            The expiry of the intent. After expiry, the intent cannot be filled
            and can only be closed.

            Specified if and only if the request included the user's public key.
        feeBudget:
          type: integer
          format: int64
          description: >-
            Maximum amount that the user is willing to pay to have the intent
            processed in lamports.

            This includes all transaction fees and tips for the open transaction
            and all transaction

            fees and tips for the fill and close transactions.
          minimum: 0
        inAmount:
          type: string
          description: >-
            Maximum input amount as a scaled integer. For example, 1 SOL is
            1000000000.
        inputMint:
          type: string
          description: Base58-encoded input mint address
        lastValidBlockHeight:
          type: integer
          format: int64
          description: >-
            The last block height at which the blockhash assigned to the open
            transaction is valid.

            Useful to determine whether the open transaction has expired.
            Specified if and only if the

            request included the user's public key.
          minimum: 0
        minOutAmount:
          type: string
          description: Same as `other_amount_threshold`
        openTransaction:
          type: string
          description: >-
            Base64-encoded intent opening transaction. The user must sign before
            sending it via the

            swap endpoint. Specified if and only if the request included the
            user's public key.
        otherAmountThreshold:
          type: string
          description: >-
            Minimum output amount after all fees as a scaled integer. If the
            swap transaction doesn't

            produce at least this amount of the output token, the transaction
            will fail.
        outAmount:
          type: string
          description: >-
            Expected output amount after all fees as a scaled integer. For
            example, 1 SOL is 1000000000.
        outputMint:
          type: string
          description: Base58-encoded output mint address
        platformFee:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/IntentPlatformFee'
              description: Platform fee that was applied to the quote, if any
        priceImpactPct:
          type: string
          description: >-
            Price impact of the swap. This is an estimate of the percentage
            difference between the

            expected price for the swap and the price for the same swap with the
            smallest input amount

            possible. For example, "0.01" means 1% price impact.
        slippageBps:
          type: integer
          format: int32
          description: Max allowed slippage % in basis points
          minimum: 0
    SubmitIntentBadRequestCode:
      type: string
      enum:
        - invalid_input_mint
        - invalid_output_mint
        - same_input_and_output_mint
        - invalid_in_amount
        - invalid_out_amount
        - invalid_fee_account
        - invalid_open_instruction_fee_budget_too_low
        - invalid_open_transaction
        - invalid_open_instruction_data
        - failed_to_simulate_open_transaction
        - open_transaction_simulation_failed
    IntentExpiry:
      oneOf:
        - type: object
          description: >-
            The intent will expire after the specified number of slots have
            passed since the open

            transaction was processed. For example, if the open transaction was
            processed in slot 100, a

            value of 10 means the intent will be fillable through slot 110.
            After slot 110, the intent

            will no longer be fillable.
          required:
            - slotsAfterOpen
          properties:
            slotsAfterOpen:
              type: integer
              format: int32
              description: >-
                The intent will expire after the specified number of slots have
                passed since the open

                transaction was processed. For example, if the open transaction
                was processed in slot 100, a

                value of 10 means the intent will be fillable through slot 110.
                After slot 110, the intent

                will no longer be fillable.
              minimum: 0
    IntentPlatformFee:
      type: object
      required:
        - amount
        - feeBps
        - segmenterFeeAmount
        - segmenterFeePct
        - feeAccount
      properties:
        amount:
          type: string
          description: Platform fee as a scaled integer. For example, 1 SOL is 1000000000.
        feeAccount:
          type: string
          description: Token account that will receive the platform fee
        feeBps:
          type: integer
          format: int32
          description: Platform fee in basis points
          minimum: 0
        segmenterFeeAmount:
          type: string
          description: Segmenter fee as a scaled integer. For example, 1 SOL is 1000000000.
        segmenterFeePct:
          type: integer
          format: int32
          description: Segmenter fee in percent
          minimum: 0
  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.

````