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

# Create Swap Transaction

> Construct an unsigned swap transaction from a previously obtained quote route.



## OpenAPI

````yaml openapi/defi-api.json POST /api/defi/v1/transactions/swap/build
openapi: 3.0.3
info:
  title: DeFi API
  version: 1.0.0
servers:
  - url: https://edge.p2p.org
security:
  - ClientHash: []
  - ApiKey: []
tags:
  - name: Earning
  - name: Positions
  - name: Rewards
  - name: Transactions
  - name: Wallets
paths:
  /api/defi/v1/transactions/swap/build:
    post:
      tags:
        - Transactions
      summary: Create Swap Transaction
      description: >-
        Construct an unsigned swap transaction from a previously obtained quote
        route.
      operationId: build_swap_transaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - inChain
                - wallet
                - inTokenSymbol
                - outTokenSymbol
                - amount
                - route
              properties:
                inChain:
                  type: string
                  example: ethereum
                wallet:
                  type: string
                  description: User wallet address (EOA).
                inTokenSymbol:
                  type: string
                  enum:
                    - USDC
                    - USDT
                outTokenSymbol:
                  type: string
                  enum:
                    - USR
                amount:
                  type: string
                  description: Amount in smallest units.
                  example: '1000000'
                slippageBps:
                  type: integer
                  minimum: 0
                  maximum: 2000
                  description: Slippage tolerance in basis points.
                provider:
                  type: string
                  example: kyberswap
                route:
                  type: object
                  description: Opaque route data from /swap/quote endpoint.
      responses:
        '200':
          description: Unsigned swap transaction.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      inToken:
                        $ref: '#/components/schemas/Asset'
                      outToken:
                        $ref: '#/components/schemas/Asset'
                      provider:
                        type: string
                      spender:
                        type: string
                      willSpendAmount:
                        type: string
                      receive:
                        type: string
                      minReceive:
                        type: string
                      transaction:
                        type: object
                        properties:
                          to:
                            type: string
                          data:
                            type: string
                          value:
                            type: string
                          nonce:
                            type: integer
                          gasLimit:
                            type: string
                          gasPrice:
                            type: string
                      expiresTimestamp:
                        type: integer
                  error:
                    nullable: true
                    default: null
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '400':
          description: >-
            ValidationException | UnsupportedPairException |
            UnsupportedProviderException | InvalidRouteException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: BuildSwapTransactionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Asset:
      type: object
      properties:
        name:
          type: string
        ecosystem:
          type: string
        chain:
          type: string
        symbol:
          type: string
        decimals:
          type: integer
        contractAddress:
          type: string
        logoURI:
          type: string
          nullable: true
        priceUsd:
          type: number
          nullable: true
        totalSupply:
          type: number
          nullable: true
        isStakeable:
          type: boolean
    ResponseMeta:
      type: object
      properties:
        time:
          type: integer
        requestId:
          type: string
          format: uuid
    ErrorResponse:
      type: object
      properties:
        result:
          nullable: true
          default: null
        error:
          type: object
          properties:
            name:
              type: string
            message:
              type: string
            validationErrors:
              type: array
              items:
                type: object
        meta:
          $ref: '#/components/schemas/ResponseMeta'
  securitySchemes:
    ClientHash:
      type: apiKey
      in: header
      name: X-Client-Hash
    ApiKey:
      type: apiKey
      in: header
      name: apikey

````

## Related topics

- [Create a staking transaction](/reference/story-staking-stake.md)
- [Create an unstaking transaction](/reference/story-staking-unstake.md)
- [Get Yield Strategies](/reference/get-strategies.md)
- [Overview](/docs/syncro-sender-overview.md)
- [Create Staking Request](/reference/create-sei-stake-transaction.md)
