Uniswap Swap API

The Swap API from Uniswap — 4 operation(s) for swap.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

uniswap-swap-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.0
  title: Token Trading Approval Swap API
  description: 'Uniswap Labs trading APIs.


    Each operation may include the vendor extension `x-public-endpoint` (boolean): `true` when the operation is available on the public gateway for standard API keys, `false` when it is not publicly exposed. See the [OpenAPI specification extensions](https://swagger.io/docs/specification/v3_0/openapi-extensions/) definition of `x-` fields.'
servers:
- description: Uniswap Trading API
  url: https://trade-api.gateway.uniswap.org/v1
security:
- apiKey: []
tags:
- name: Swap
paths:
  /swap:
    post:
      tags:
      - Swap
      summary: Create swap calldata
      description: Create the calldata for a swap transaction (including wrap/unwrap) against the Uniswap Protocols. If the `quote` parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be **more precise** when the the response calldata would be valid if submitted on-chain.
      operationId: create_swap_transaction
      security:
      - apiKey: []
      parameters:
      - $ref: '#/components/parameters/universalRouterVersionHeader'
      - $ref: '#/components/parameters/permit2DisabledHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSwapRequest'
            example:
              quote:
                chainId: 1
                input:
                  amount: '2516'
                  token: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'
                output:
                  amount: '996320746321162'
                  token: '0x0000000000000000000000000000000000000000'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                swapper: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                route:
                - - type: v4-pool
                    address: '0x599326d9cd5e1ea0893305c87d5ec3199e7f05e94d72159f35dea381479a615e'
                    tokenIn:
                      chainId: 1
                      decimals: '8'
                      address: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'
                      symbol: WBTC
                    tokenOut:
                      chainId: 1
                      decimals: '18'
                      address: '0x0000000000000000000000000000000000000000'
                      symbol: ETH
                    fee: '500'
                    tickSpacing: '10'
                    hooks: '0x0000000000000000000000000000000000000000'
                    liquidity: '82781860385007263'
                    sqrtRatioX96: '125814565506407615477027'
                    tickCurrent: '-267075'
                    amountIn: '2516'
                    amountOut: '993829944455359'
                slippage: 5.5
                tradeType: EXACT_INPUT
                quoteId: 62e83902-9455-405d-8c62-cdf8ee9e2042
                gasFeeUSD: '1.27511942409885062'
                gasFeeQuote: '489108586810000'
                gasUseEstimate: '180350'
                priceImpact: 0.14
                txFailureReasons: []
                maxPriorityFeePerGas: '2000000000'
                maxFeePerGas: '4656513686'
                gasFee: '489108586810000'
                routeString: '[V4] 100.00% = WBTC -- 0.05% [0x599326d9cd5e1ea0893305c87d5ec3199e7f05e94d72159f35dea381479a615e]ETH'
                blockNumber: '22483653'
                aggregatedOutputs:
                - amount: '993829944455360'
                  token: '0x0000000000000000000000000000000000000000'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                  bps: 9975
                  minAmount: '993829944455360'
                - amount: '2490801865802'
                  token: '0x0000000000000000000000000000000000000000'
                  recipient: '0x000000fee13a103A10D593b9AE06b3e05F2E7E1c'
                  bps: 25
                  minAmount: '2490801865802'
                portionAmount: '2490801865802'
                portionBips: 25
                portionRecipient: '0x000000fee13a103A10D593b9AE06b3e05F2E7E1c'
              permitData:
                domain:
                  name: Permit2
                  chainId: 1
                  verifyingContract: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
                types:
                  PermitSingle:
                  - name: details
                    type: PermitDetails
                  - name: spender
                    type: address
                  - name: sigDeadline
                    type: uint256
                  PermitDetails:
                  - name: token
                    type: address
                  - name: amount
                    type: uint160
                  - name: expiration
                    type: uint48
                  - name: nonce
                    type: uint48
                values:
                  details:
                    token: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'
                    amount: '1461501637330902918203684832716283019655932542975'
                    expiration: '1749845047'
                    nonce: '1'
                  spender: '0x66a9893cc07d91d95644aedd05d03f95e1dba8af'
                  sigDeadline: '1747254847'
              signature: 0xb22e7f47d8...
              simulateTransaction: true
              refreshGasPrice: true
              safetyMode: SAFE
              urgency: normal
      responses:
        '200':
          $ref: '#/components/responses/CreateSwapSuccess200'
        '400':
          $ref: '#/components/responses/BadRequest400'
        '401':
          $ref: '#/components/responses/SwapUnauthorized401'
        '404':
          $ref: '#/components/responses/SwapNotFound404'
        '429':
          $ref: '#/components/responses/RateLimitedErr429'
        '500':
          $ref: '#/components/responses/InternalErr500'
        '504':
          $ref: '#/components/responses/Timeout504'
      x-public-endpoint: true
  /swaps:
    get:
      tags:
      - Swap
      summary: Get swaps status
      description: Get the status of swap or bridge transactions. Accepts on-chain transaction hashes (`txHashes`), ERC-4337 userOperation hashes (`userOpHashes`), or both. At least one of the two must contain at least one item.
      operationId: get_swaps
      security:
      - apiKey: []
      parameters:
      - $ref: '#/components/parameters/transactionHashesParam'
      - $ref: '#/components/parameters/userOpHashesParam'
      - $ref: '#/components/parameters/chainIdParam'
      responses:
        '200':
          $ref: '#/components/responses/GetSwapsSuccess200'
        '400':
          $ref: '#/components/responses/BadRequest400'
        '404':
          $ref: '#/components/responses/SwapNotFound404'
        '429':
          $ref: '#/components/responses/RateLimitedErr429'
        '500':
          $ref: '#/components/responses/InternalErr500'
        '504':
          $ref: '#/components/responses/Timeout504'
      x-public-endpoint: true
  /swap_5792:
    post:
      tags:
      - Swap
      summary: Create swap EIP 5792 calldata
      description: Create the EIP 5792 calldata for a swap transaction (including wrap/unwrap and bridging) against the Uniswap Protocols. If the `quote` parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be **more precise** when the response calldata would be valid if submitted on-chain.
      operationId: create_swap_5792_transaction
      security:
      - apiKey: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSwap5792Request'
            example:
              quote:
                chainId: 8453
                swapper: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                tradeType: EXACT_INPUT
                route:
                - - type: v4-pool
                    address: '0x636da53e0251b3cb0b4d10dbaff488b294f97bd5212b7e2a7c1bc3fb57fd6e31'
                    tokenIn:
                      address: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                      chainId: 8453
                      symbol: SOSO
                      decimals: '18'
                    tokenOut:
                      address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                      chainId: 8453
                      symbol: USDC
                      decimals: '6'
                    sqrtRatioX96: '51868315841017165286814'
                    liquidity: '60642987270239502'
                    tickCurrent: '-284797'
                    fee: '1'
                    tickSpacing: '1'
                    hooks: '0x0000000000000000000000000000000000000000'
                    amountIn: '4666414752365827583'
                    amountOut: '1999890'
                input:
                  amount: '4666414752365827583'
                  token: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                output:
                  amount: '1999890'
                  token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                slippage: 2.5
                priceImpact: 0.01
                gasFee: '1664618749624'
                gasFeeUSD: '0.002335228716641861'
                gasFeeQuote: '2335'
                gasUseEstimate: '162169'
                routeString: '[v4] 100.00% = [0.0001%] [1] [0x0000000000000000000000000000000000000000] 0x636da53e0251b3cb0b4d10dbaff488b294f97bd5212b7e2a7c1bc3fb57fd6e31'
                blockNumber: '45041016'
                quoteId: dccb2b4f-3b0c-46be-8e17-9fb103d44990
                gasPrice: '9000000'
                txFailureReasons: []
                aggregatedOutputs:
                - amount: '1999890'
                  token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                  bps: 10000
                  minAmount: '1949892'
              permitData:
                domain:
                  name: Permit2
                  chainId: 8453
                  verifyingContract: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
                types:
                  PermitSingle:
                  - name: details
                    type: PermitDetails
                  - name: spender
                    type: address
                  - name: sigDeadline
                    type: uint256
                  PermitDetails:
                  - name: token
                    type: address
                  - name: amount
                    type: uint160
                  - name: expiration
                    type: uint48
                  - name: nonce
                    type: uint48
                values:
                  details:
                    token: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                    amount: '1461501637330902918203684832716283019655932542975'
                    expiration: '1779463380'
                    nonce: '0'
                  spender: '0x6ff5693b99212da76ad316178a184ab56d299b43'
                  sigDeadline: '1776873180'
              urgency: normal
      parameters:
      - $ref: '#/components/parameters/universalRouterVersionHeader'
      responses:
        '200':
          $ref: '#/components/responses/CreateSwap5792Success200'
        '400':
          $ref: '#/components/responses/BadRequest400'
        '401':
          $ref: '#/components/responses/SwapUnauthorized401'
        '404':
          $ref: '#/components/responses/SwapNotFound404'
        '429':
          $ref: '#/components/responses/RateLimitedErr429'
        '500':
          $ref: '#/components/responses/InternalErr500'
        '504':
          $ref: '#/components/responses/Timeout504'
      x-public-endpoint: true
  /swap_7702:
    post:
      tags:
      - Swap
      summary: Create swap EIP 7702 calldata
      description: 'Create the EIP 7702 calldata for a swap transaction (including wrap/unwrap and bridging) against the Uniswap Protocols. If the `quote` parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be **more precise** when the the response calldata would be valid if submitted on-chain.


        Native ETH / UniswapX setup: When `x-erc20eth-enabled` is `true` and the input token is native ETH, the response may include an additional native approval call (e.g. an `approveNative` step) to enable ERC20-ETH (EIP-7914) spending for the wallet. This native allowance is a prerequisite for native ETH input on UniswapX (`/quote` → `/order`) for supported wallets.'
      operationId: create_swap_7702_transaction
      security:
      - apiKey: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSwap7702Request'
            example:
              quote:
                chainId: 8453
                swapper: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                tradeType: EXACT_INPUT
                route:
                - - type: v4-pool
                    address: '0x636da53e0251b3cb0b4d10dbaff488b294f97bd5212b7e2a7c1bc3fb57fd6e31'
                    tokenIn:
                      address: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                      chainId: 8453
                      symbol: SOSO
                      decimals: '18'
                    tokenOut:
                      address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                      chainId: 8453
                      symbol: USDC
                      decimals: '6'
                    sqrtRatioX96: '51868315841017165286814'
                    liquidity: '60642987270239502'
                    tickCurrent: '-284797'
                    fee: '1'
                    tickSpacing: '1'
                    hooks: '0x0000000000000000000000000000000000000000'
                    amountIn: '4666414752365827583'
                    amountOut: '1999890'
                input:
                  amount: '4666414752365827583'
                  token: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                output:
                  amount: '1999890'
                  token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                slippage: 2.5
                priceImpact: 0.01
                gasFee: '1636896419348'
                gasFeeUSD: '0.002335228716641861'
                gasFeeQuote: '2335'
                gasUseEstimate: '162169'
                routeString: '[v4] 100.00% = [0.0001%] [1] [0x0000000000000000000000000000000000000000] 0x636da53e0251b3cb0b4d10dbaff488b294f97bd5212b7e2a7c1bc3fb57fd6e31'
                blockNumber: '45041659'
                quoteId: ce44f65c-b16a-46e3-a3cf-23cadea6110b
                gasPrice: '9000000'
                txFailureReasons: []
                aggregatedOutputs:
                - amount: '1999890'
                  token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                  recipient: '0xC9bebBA9f481b12cE6f3EA54c4B182c9636ec421'
                  bps: 10000
                  minAmount: '1949892'
              permitData:
                domain:
                  name: Permit2
                  chainId: 8453
                  verifyingContract: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
                types:
                  PermitSingle:
                  - name: details
                    type: PermitDetails
                  - name: spender
                    type: address
                  - name: sigDeadline
                    type: uint256
                  PermitDetails:
                  - name: token
                    type: address
                  - name: amount
                    type: uint160
                  - name: expiration
                    type: uint48
                  - name: nonce
                    type: uint48
                values:
                  details:
                    token: '0x624e2e7fDc8903165F64891672267AB0FCB98831'
                    amount: '1461501637330902918203684832716283019655932542975'
                    expiration: '1779464665'
                    nonce: '0'
                  spender: '0x6ff5693b99212da76ad316178a184ab56d299b43'
                  sigDeadline: '1776874465'
              smartContractDelegationAddress: '0x000000009b1d0af20d8c6d0a44e162d11f9b8f00'
      parameters:
      - $ref: '#/components/parameters/universalRouterVersionHeader'
      - $ref: '#/components/parameters/erc20EthEnabledHeader'
      responses:
        '200':
          $ref: '#/components/responses/CreateSwap7702Success200'
        '400':
          $ref: '#/components/responses/BadRequest400'
        '401':
          $ref: '#/components/responses/SwapUnauthorized401'
        '404':
          $ref: '#/components/responses/SwapNotFound404'
        '429':
          $ref: '#/components/responses/RateLimitedErr429'
        '500':
          $ref: '#/components/responses/InternalErr500'
        '504':
          $ref: '#/components/responses/Timeout504'
      x-public-endpoint: true
components:
  parameters:
    userOpHashesParam:
      description: ERC-4337 UserOperation hashes. At least one of `txHashes` or `userOpHashes` must be provided.
      name: userOpHashes
      in: query
      required: false
      style: form
      explode: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/TransactionHash'
      example:
      - '0xd47b609961a02483c9516d1f326244357e7e0b1d91569ebb4d119dff17e47330'
    permit2DisabledHeader:
      name: x-permit2-disabled
      in: header
      description: Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.
      required: false
      schema:
        type: boolean
        default: false
    chainIdParam:
      name: chainId
      in: query
      schema:
        $ref: '#/components/schemas/ChainId'
      required: false
    universalRouterVersionHeader:
      name: x-universal-router-version
      in: header
      description: The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls.
      required: false
      schema:
        $ref: '#/components/schemas/UniversalRouterVersion'
    erc20EthEnabledHeader:
      name: x-erc20eth-enabled
      in: header
      description: Enable native ETH input support for UniswapX via ERC20-ETH (EIP-7914). When set to true and `tokenIn` is the native currency address (e.g. `0x0000000000000000000000000000000000000000`), the API may return UniswapX routes that spend native ETH for supported wallets.
      required: false
      schema:
        type: boolean
        default: false
    transactionHashesParam:
      description: On-chain transaction hashes. At least one of `txHashes` or `userOpHashes` must be provided.
      name: txHashes
      in: query
      required: false
      style: form
      explode: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/TransactionHash'
      example:
      - '0xc286f0adc6a9d6d26d6114df251d9b09d8bfafb2e00af5953193f6af92e110db'
  schemas:
    CreateSwap5792Response:
      type: object
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        from:
          $ref: '#/components/schemas/Address'
        chainId:
          $ref: '#/components/schemas/ChainId'
        calls:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRequest5792'
        gasFee:
          $ref: '#/components/schemas/gasFee'
      required:
      - requestId
      - from
      - chainId
      - calls
    CreateSwap7702Request:
      type: object
      properties:
        quote:
          oneOf:
          - $ref: '#/components/schemas/ClassicQuote'
          - $ref: '#/components/schemas/WrapUnwrapQuote'
          - $ref: '#/components/schemas/BridgeQuote'
        permitData:
          $ref: '#/components/schemas/NullablePermit'
        smartContractDelegationAddress:
          $ref: '#/components/schemas/Address'
        includeGasInfo:
          type: boolean
          default: false
        deadline:
          $ref: '#/components/schemas/deadline'
        urgency:
          $ref: '#/components/schemas/Urgency'
        simulateTransaction:
          type: boolean
      required:
      - quote
    ClassicInput:
      type: object
      properties:
        token:
          $ref: '#/components/schemas/inputToken'
        amount:
          $ref: '#/components/schemas/tokenAmount'
    RequestId:
      type: string
      description: A unique ID for the request.
    Permit:
      description: the permit2 message object for the customer to sign to permit spending by the permit2 contract.
      type: object
      properties:
        domain:
          type: object
        values:
          type: object
        types:
          type: object
    gasFee:
      type: string
      description: The total estimated gas cost of this transaction (eg. `gasLimit` multiplied by `maxFeePerGas`) in the base unit of the chain.
    AggregatedOutput:
      description: An array of all outputs of the proposed transaction. This includes the swap as well as any fees collected by the API integrator. This does not include pool fees when routing is through a Uniswap Protocol pool.
      type: object
      properties:
        token:
          $ref: '#/components/schemas/outputToken'
        amount:
          $ref: '#/components/schemas/tokenAmount'
        recipient:
          $ref: '#/components/schemas/receiverWalletAddress'
        bps:
          $ref: '#/components/schemas/bps'
        minAmount:
          $ref: '#/components/schemas/minAmount'
    portionBips:
      type: number
      multipleOf: 0.01
      description: The portion of the swap that will be taken as a fee stated in basis points. Fractional basis points are supported with up to two decimal places (e.g. 87.5 for 0.875%). The fee will be taken from the output token.
    Routing:
      type: string
      enum:
      - CLASSIC
      - DUTCH_LIMIT
      - DUTCH_V2
      - DUTCH_V3
      - BRIDGE
      - LIMIT_ORDER
      - PRIORITY
      - WRAP
      - UNWRAP
      - CHAINED
      description: The routing for the proposed transaction.
    sqrtRatioX96:
      type: string
      description: The square root of the ratio of the token0 and token1 in the pool, as a Q64.64 number. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap.org/whitepaper-v3.pdf).
    tokenSymbol:
      type: string
      description: The symbol of the token.
    receiverWalletAddress:
      type: string
      description: The wallet address which will receive the token.
      pattern: ^(0x)?[0-9a-fA-F]{40}$
    Err401:
      type: object
      properties:
        errorCode:
          default: UnauthorizedError
          type: string
        detail:
          type: string
    contractAddress:
      type: string
      description: The address of a contract which will be used to facilitate the swap.
      pattern: ^(0x)?[0-9a-fA-F]{40}$
    WrapUnwrapQuote:
      title: Wrap/Unwrap Quote
      type: object
      properties:
        swapper:
          $ref: '#/components/schemas/receiverWalletAddress'
        input:
          $ref: '#/components/schemas/ClassicInput'
        output:
          $ref: '#/components/schemas/ClassicOutput'
        chainId:
          $ref: '#/components/schemas/ChainId'
        tradeType:
          $ref: '#/components/schemas/TradeType'
        gasFee:
          $ref: '#/components/schemas/gasFee'
        gasFeeUSD:
          $ref: '#/components/schemas/gasFeeUSD'
        gasFeeQuote:
          $ref: '#/components/schemas/gasFeeInCurrency'
        gasUseEstimate:
          $ref: '#/components/schemas/gasLimit'
        gasPrice:
          $ref: '#/components/schemas/gasPrice'
        maxFeePerGas:
          $ref: '#/components/schemas/maxFeePerGas'
        maxPriorityFeePerGas:
          $ref: '#/components/schemas/maxPriorityFeePerGas'
    quoteId:
      type: string
      description: A unique ID for the quote.
    outputToken:
      type: string
      description: The token which will be received, specified by its token address. For a list of supported tokens, see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
      pattern: ^(0x)?[0-9a-fA-F]{40}$
    maxPriorityFeePerGas:
      type: string
      description: The maximum tip to the block builder. Adjusted based upon the urgency specified in the request.
    SwapSafetyMode:
      type: string
      enum:
      - SAFE
      description: Swap safety mode will automatically sweep the transaction for the native token and return it to the sender wallet address. This is to prevent accidental loss of funds in the event that the token amount is set in the transaction value instead of as part of the calldata.
    CreateSwap7702Response:
      type: object
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        swap:
          $ref: '#/components/schemas/TransactionRequest'
        gasFee:
          $ref: '#/components/schemas/gasFee'
      required:
      - requestId
      - swap
    GetSwapsResponse:
      type: object
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        swaps:
          type: array
          items:
            type: object
            properties:
              swapType:
                $ref: '#/components/schemas/Routing'
              status:
                $ref: '#/components/schemas/SwapStatus'
              txHash:
                $ref: '#/components/schemas/TransactionHash'
                description: On-chain transaction hash. Present for transaction queries and for userOperation queries once the userOp has been included on-chain.
              swapId:
                type: string
              userOpHash:
                $ref: '#/components/schemas/TransactionHash'
                description: ERC-4337 userOperation hash. Present only when the row corresponds to a userOperation query.
              hashType:
                type: string
                enum:
                - TX
                - USER_OP
                description: Identifies whether the row was resolved from a transaction hash or a userOperation hash. Omitted on transaction rows; absence is equivalent to `TX`.
      required:
      - requestId
      - status
    CreateSwap5792Request:
      type: object
      properties:
        quote:
          oneOf:
          - $ref: '#/components/schemas/ClassicQuote'
          - $ref: '#/components/schemas/WrapUnwrapQuote'
          - $ref: '#/components/schemas/BridgeQuote'
        permitData:
          $ref: '#/components/schemas/NullablePermit'
        deadline:
          $ref: '#/components/schemas/deadline'
        urgency:
          $ref: '#/components/schemas/Urgency'
      required:
      - quote
    tokenAmount:
      type: string
      description: The quantity of tokens denominated in the token's base units. (For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is 1x10^6 base units.) This value must be greater than 0.
      pattern: ^[0-9]+$
    NullablePermit:
      description: the permit2 message object for the customer to sign to permit spending by the permit2 contract.
      type: object
      nullable: true
      properties:
        domain:
          type: object
        values:
          type: object
        types:
          type: object
    deadline:
      type: number
      description: The unix timestamp at which the order will be reverted if not filled.
    bps:
      type: number
      multipleOf: 0.01
      description: The portion of the swap stated in basis points. Fractional basis points are supported with up to two decimal places (e.g. 12.5).
    Err500:
      type: object
      properties:
        errorCode:
          default: InternalServerError
          type: string
        detail:
          type: string
    SwapStatus:
      type: string
      enum:
      - PENDING
      - SUCCESS
      - NOT_FOUND
      - FAILED
      - EXPIRED
    liquidity:
      type: string
      description: The amount of liquidity in the pool at a given tick. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap.org/whitepaper-v3.pdf).
    inputToken:
      type: string
      description: The token which will be sent, specified by its token address. For a list of supported tokens, see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
      pattern: ^(0x)?[0-9a-fA-F]{40}$
    Err404:
      type: object
      properties:
        errorCode:
          enum:
          - ResourceNotFound
          - QuoteAmountTooLowError
          - TokenBalanceNotAvailable
          - InsufficientBalance
          type: string
        detail:
          type: string
    V4PoolInRoute:
      title: V4 Route
      type: object
      properties:
        type:
          type: string
          default: v4-pool
        address:
          $ref: '#/components/schemas/contractAddress'
        tokenIn:
          $ref: '#/components/schemas/TokenInRoute'
        tokenOut:
          $ref: '#/components/schemas/TokenInRoute'
        sqrtRatioX96:
          $ref: '#/components/schemas/sqrtRatioX96'
        liquidity:
          $ref: '#/components/schemas/liquidity'
        tickCurrent:
          $ref: '#/components/schemas/tickCurrent'
        fee:
          $ref: '#/components/schemas/poolFee'
        tickSpacing:
          $ref: '#/components/schemas/tickSpacing'
        hooks:
          type: string
          description: The address of the hook for the pool, if any. If the pool has no hook, this field will be the null address (e.g. 0x0000000000000000000000000000000000000000).
        amountIn:
          $ref: '#/components/schemas/tokenAmount'
        amountOut:
          $ref: '#/components/schemas/tokenAmount'
      required:
      - type
      - address
      - tokenIn
      - tokenOut
      - sqrtRatioX96
      - liquidity
      - tickCurrent
      - fee
      - tickSpacing
      - hooks
    TradeType:
      type: string
      enum:
      - EXACT_INPUT
      - EXACT_OUTPUT
      description: The handling of the `amount` field. `EXACT_INPUT` means the requester will send the specified `amount` of input tokens and get a quote with a variable quantity of output tokens. `EXACT_OUTPUT` means the requester will receive the specified `amount` of output tokens and get a quote with a variable quantity of input tokens.
      default: EXACT_INPUT
    ClassicQuote:
      title: Classic Quote
      type: object
      properties:
        input:
          $ref: '#/components/schemas/ClassicInput'
        output:
          $ref: '#/components/schemas/ClassicOutput'
        swapper:
          $ref: '#/components/schemas/senderWalletAddress'
        chainId:
          $ref: '#/components/schemas/ChainId'
        slippage:
          $ref: '#/components/schemas/slippageTolerance'
        tradeType:
          $ref: '#/components/schemas/TradeType'
        gasFee:
          $ref: '#/components/schemas/gasFee'
        gasFeeUSD:
          $ref: '#/components/schemas/gasFeeUSD'
        gasFeeQuote:
          $ref: '#/components/schemas/gasFeeInCurrency'
        route:
          type: array
          items:
            type: array
            items:
              oneOf:
              - $ref: '#/components/schemas/V2PoolInRoute'
              - $ref: '#/components/schemas/V3PoolInRoute'
              - $ref: '#/components/schemas/V4PoolInRoute'
        portionBips:
          $ref: '#/components/schemas/portionBips'
        portionAmount:
          $ref: '#/components/schemas/portionAmount'
        portionRecipient:
          $ref: '#/components/schemas/portionAmountReceiverAddress'
        routeString:
          type: string
          description: The route in string format.
        quoteId:
          $ref: '#/components/schemas/quoteId'
        gasUseEstimate:
          type: string
          description: The estimated gas use. It does NOT include the additional gas for token approvals.
        blockNumber:
          type: string
          description: 

# --- truncated at 32 KB (49 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/uniswap/refs/heads/main/openapi/uniswap-swap-api-openapi.yml