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

# Get swap quote

> Returns a persisted quote for swapping tokens on same or different chains. Provide either `originChain` + `destinationChain` or `chainIdIn` + `chainIdOut`. Provide exactly one of `amountIn` or `amountOut`. Quotes expire after 5 minutes; `quote.deadline` is a Unix timestamp in seconds and `quote.deadlineDate` is an ISO 8601 string (UTC).



## OpenAPI

````yaml /openapi.yaml get /v2/swap/quote
openapi: 3.0.0
info:
  version: 2.0.0
  title: Pods API
  description: >
    # Pods API Documentation


    Pods API is a comprehensive DeFi aggregation platform that enables
    cross-chain and same-chain transactions for yield strategies.


    ## Key Features


    - **Cross-Chain Swaps**: Swap tokens across different blockchain networks

    - **Same-Chain Swaps**: Optimal routing for swaps within the same network

    - **Yield Strategies**: Access to multiple DeFi protocols (Aave, Morpho,
    Lido, etc.)

    - **Wallet Tracking**: Monitor positions and yields across protocols

    - **Transaction Monitoring**: Real-time status updates for cross-chain
    transactions


    ## Authentication


    Most API endpoints require authentication using an API key in the
    `x-api-key` header:


    ```

    x-api-key: your-api-key-here

    ```


    Obtain your API key from the Pods dashboard.


    **Exceptions:**

    - `GET /health` is public and does not require authentication.

    - Customer dashboard endpoints (e.g. `GET /customers/me`,
    `/customers/:id/tokens`, `/customers/:id/token-groups`) require a **Bearer**
    token (Supabase or Magic JWT). API key alone is not sufficient for these
    routes because they enforce user role checks.


    ## Base URL


    Production: `https://api.pods.finance`


    ## Rate Limits


    - 100 requests per minute per API key

    - 1000 requests per hour per API key


    ## Quote Expiration


    Quotes expire after 5 minutes. The `deadline` field is a Unix timestamp in
    seconds and `deadlineDate` is an ISO 8601 string (UTC); request a new quote
    when the deadline has passed.


    ## Error Handling


    All errors follow a consistent format. The HTTP status line is the source of
    truth — the body does **not** include `httpStatus`:


    ```json

    {
      "error": {
        "code": "ERROR_CODE",
        "message": "Human-readable error message",
        "details": {}
      }
    }

    ```


    ## Common Error Codes


    - **QUOTE_NOT_FOUND** (404): Quote not found or expired

    - **ACTION_NOT_FOUND** (404): Action not found

    - **STRATEGY_NOT_FOUND** (404): Strategy not found

    - **INVALID_ACTION_TYPE** (400): Action type is not supported for this
    endpoint

    - **QUOTE_EXPIRED** (400): Quote has expired

    - **QUOTE_VALIDATION_ERROR** (400): Quote validation failed

    - **PROVIDER_NOT_FOUND** (404): Swap provider not found

    - **NO_ROUTE_FOUND** (400): No swap route available between specified chains

    - **INVALID_PREFERRED_PROVIDER** (400): Unknown preferredProvider name

    - **PREFERRED_PROVIDER_NOT_ELIGIBLE** (400): preferredProvider is not
    eligible for this swap route

    - **PREFERRED_PROVIDER_QUOTE_UNAVAILABLE** (400): No quote was returned for
    the requested preferredProvider

    - **QUOTE_GENERATION_FAILED** (400): Could not generate quote for specified
    parameters

    - **FEE_SPONSORSHIP_NOT_ALLOWED** (403): Fee sponsorship is not allowed for
    this customer

    - **INVALID_TX_HASH** (400): Invalid transaction hash format

    - **TX_UPDATE_FAILED** (500): Failed to update transaction status

    - **INVALID_AMOUNT_PARAMS** (400): Cannot specify both amountIn and
    amountOut simultaneously

    - **MISSING_AMOUNT_PARAMS** (400): Either amountIn or amountOut is required

    - **INVALID_SLIPPAGE** (400): slippage must be a number between 0.0001 and
    0.5 (fraction of 1, e.g. 0.01 = 1%)

    - **AMOUNT_IN_TOO_LOW** (400): AmountIn is below the minimum for this route

    - **AMOUNT_IN_TOO_HIGH** (400): AmountIn exceeds available liquidity for
    this route. Try a smaller amount.

    - **AMOUNT_IN_TOO_LOW_OFFRAMP** (400): AmountIn must be greater than 1 USDC

    - **AMOUNT_IN_TOO_HIGH_OFFRAMP** (400): AmountIn must be less than 5k USDC

    - **AMOUNT_OUT_TOO_LOW_OFFRAMP** (400): AmountOut must be greater than 5
    BRLA

    - **AMOUNT_OUT_TOO_HIGH_OFFRAMP** (400): AmountOut must be less than 26k
    BRLA

    - **AMOUNT_IN_TOO_LOW_ONRAMP** (400): AmountIn must be greater than 5 BRLA

    - **AMOUNT_IN_TOO_HIGH_ONRAMP** (400): AmountIn must be less than 75k BRLA

    - **AMOUNT_OUT_TOO_LOW_ONRAMP** (400): AmountOut must be greater than 1 USDC

    - **AMOUNT_OUT_TOO_HIGH_ONRAMP** (400): AmountOut must be less than 15k USDC

    - **TRANSFER_VALIDATION_FAILED** (400): Token transfer validation failed

    - **REFUND_PROCESSING_FAILED** (500): Failed to process refund transaction

    - **INSUFFICIENT_AMOUNT_FOR_REFUND** (400): Transferred amount insufficient
    to cover refund fee

    - **FORBIDDEN** (403): Access denied

    - **INTERNAL_SERVER_ERROR** (500): An unexpected error occurred

    - **BYTECODE_GENERATION_FAILED** (500): Failed to generate transaction
    bytecode

    - **SWAP_EXECUTION_FAILED** (500): Failed to execute swap transaction

    - **KAMINO_SERVICE_UNAVAILABLE** (503): Lending service is temporarily
    unavailable. Please try again later.

    - **KAMINO_BAD_REQUEST** (400): Invalid request to lending service

    - **DEPOSIT_NOT_FOUND** (404): Bitcoin deposit not found

    - **SYMBIOSIS_API_ERROR** (502): Error communicating with Symbiosis API


    ## Support


    - Documentation: https://docs.pods.finance

    - Support: support@pods.finance
  contact:
    name: Pods Support
    email: support@pods.finance
    url: https://pods.finance
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.pods.finance
    description: Production server
security: []
tags:
  - name: Health
    description: Health check endpoints
  - name: KYC
    description: Reusable Sumsub KYC import and status endpoints
  - name: Swap v2
    description: Token swap operations (latest version)
  - name: Tracking
    description: Execution tracking for swaps, transfers, and strategy operations
  - name: Strategies
    description: DeFi yield strategy operations
  - name: Ondo
    description: Ondo Global Markets (tokenized stocks & ETFs)
  - name: Tokens
    description: Token catalog (requires wallet product type)
  - name: Transfer
    description: Token transfer transaction generation
  - name: Wallets
    description: Wallet position tracking
  - name: Customers
    description: Customer account management (Bearer auth)
  - name: Quotes
    description: Quote history and management
  - name: Smart Account
    description: ERC-4337 Gnosis Safe smart account provisioning
paths:
  /v2/swap/quote:
    get:
      tags:
        - Swap v2
      summary: Get swap quote
      description: >-
        Returns a persisted quote for swapping tokens on same or different
        chains. Provide either `originChain` + `destinationChain` or `chainIdIn`
        + `chainIdOut`. Provide exactly one of `amountIn` or `amountOut`. Quotes
        expire after 5 minutes; `quote.deadline` is a Unix timestamp in seconds
        and `quote.deadlineDate` is an ISO 8601 string (UTC).
      parameters:
        - schema:
            type: string
            description: Origin blockchain network name. Use with destinationChain.
            example: ethereum
          required: false
          name: originChain
          in: query
        - schema:
            type: number
            description: Origin chain ID. Alternative to originChain.
            example: 1
          required: false
          name: chainIdIn
          in: query
        - schema:
            type: string
            description: Destination blockchain network name. Use with originChain.
            example: polygon
          required: false
          name: destinationChain
          in: query
        - schema:
            type: number
            description: Destination chain ID. Alternative to destinationChain.
            example: 137
          required: false
          name: chainIdOut
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/Address'
              - description: Input token contract address
          required: true
          name: tokenIn
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/Address'
              - description: Output token contract address
          required: true
          name: tokenOut
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/BigIntLike'
              - description: >-
                  Input amount (in token smallest unit). Provide either amountIn
                  or amountOut, not both.
          required: false
          name: amountIn
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/BigIntLike'
              - description: >-
                  Desired output amount (in token smallest unit). Provide either
                  amountIn or amountOut, not both.
          required: false
          name: amountOut
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/Address'
              - description: Recipient address on destination chain
          required: false
          name: destinationAddress
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/Address'
              - description: >-
                  Sender address on origin chain. When provided together with
                  destinationAddress, the response also includes executable
                  payload fields (`id` plus `transactionData`, `userOperation`,
                  or Fireblocks data depending on `output`).
          required: false
          name: originAddress
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/Address'
              - description: Address for refunds if swap fails
          required: false
          name: refundAddress
          in: query
        - schema:
            type: string
            enum:
              - bytecode
              - userOperation
              - fireblocks
            default: bytecode
            description: >-
              Response format when both originAddress and destinationAddress are
              provided. Defaults to `bytecode`. `userOperation` and `fireblocks`
              are EVM-origin only.
          required: false
          name: output
          in: query
        - schema:
            type: string
            description: Fireblocks vault account ID. Required when output=fireblocks.
            example: '12'
          required: false
          name: accountId
          in: query
        - schema:
            type: boolean
            description: Request fee sponsorship on eligible Pods bridge routes
            example: false
          required: false
          name: feeSponsorship
          in: query
        - schema:
            type: string
            description: Registered provider name to force when eligible for the route
            example: relay
          required: false
          name: preferredProvider
          in: query
        - schema:
            type: string
            description: >-
              Slippage tolerance as a fraction of 1. Valid range is 0.0001 to
              0.5.
            example: '0.01'
          required: false
          name: slippage
          in: query
        - schema:
            type: string
            enum:
              - fast
              - standard
            description: Transfer speed for CCTP cross-chain swaps
            example: fast
          required: false
          name: transferSpeed
          in: query
        - schema:
            type: string
            format: uri
            description: >-
              Optional per-quote webhook endpoint. When set, quote lifecycle
              webhooks are delivered to this URL instead of the customer default
              webhookURL.
            example: https://example.com/webhooks/swap-quote
          required: false
          name: webhookURL
          in: query
      responses:
        '200':
          description: Quote generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  quote:
                    $ref: '#/components/schemas/Quote'
                  id:
                    type: string
                    description: Action ID for execution tracking when bytecode is included
                  chainId:
                    type: number
                    description: Origin chain ID when bytecode is included
                  transactionData:
                    anyOf:
                      - type: array
                        items:
                          $ref: '#/components/schemas/TransactionData'
                      - $ref: '#/components/schemas/SolanaTransactionData'
                    description: >-
                      Executable transactions when output=bytecode (default) and
                      both addresses are provided
                  userOperation:
                    nullable: true
                    description: >-
                      ERC-4337 user operation when output=userOperation and both
                      addresses are provided
                required:
                  - quote
        '400':
          description: Bad request - invalid parameters or no route found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Address:
      type: string
      description: Ethereum address (EVM-compatible)
      example: '0xb794F5eA0ba39494cE839613fffBA74279579268'
    BigIntLike:
      type: string
      description: Large integer represented as string (for amounts with decimals)
      example: '1000000000000000000'
    Quote:
      type: object
      properties:
        id:
          type: string
          description: Unique quote identifier
          example: 550e8400-e29b-41d4-a716-446655440000
        quoteId:
          type: string
          description: Quote ID (same as id)
          example: 550e8400-e29b-41d4-a716-446655440000
        chainIdIn:
          type: number
          description: Canonical source chain ID
          example: 1
        chainIdOut:
          type: number
          description: Canonical destination chain ID
          example: 137
        originChain:
          type: string
          example: ethereum
        destinationChain:
          type: string
          example: polygon
        tokenIn:
          $ref: '#/components/schemas/Token'
        tokenOut:
          $ref: '#/components/schemas/Token'
        provider:
          type: string
          description: Swap provider name
          example: teleswap
        rawQuote:
          nullable: true
          description: Provider-specific quote data
        deadline:
          type: integer
          description: Quote expiration Unix timestamp in seconds
          example: 1705753800
        deadlineDate:
          type: string
          format: date-time
          description: Quote expiration instant as ISO 8601 UTC
          example: '2024-01-20T12:30:00.000Z'
        status:
          type: string
          enum:
            - pending
            - confirmed
            - fulfilled
            - expired
            - failed
            - refunded
            - processing
          example: pending
        feeSponsorship:
          type: boolean
          example: false
        customer:
          type: string
          description: Customer ID
        feeBreakdown:
          allOf:
            - $ref: '#/components/schemas/SwapFeeBreakdown'
            - description: >-
                Canonical itemized swap costs (Pods, customer, bridge +
                slippage). Use this field for all fee display and accounting in
                new integrations. Not returned on GET /v2/swap/status/:id.
      required:
        - id
        - quoteId
        - originChain
        - destinationChain
        - tokenIn
        - tokenOut
        - provider
        - deadline
        - deadlineDate
      description: Freshly generated swap quote returned by GET /v2/swap/quote
    TransactionData:
      type: object
      properties:
        chainId:
          allOf:
            - $ref: '#/components/schemas/BigIntLike'
            - description: Chain ID as decimal string
              example: '137'
        to:
          $ref: '#/components/schemas/Address'
        data:
          type: string
          description: Transaction calldata (hex)
          example: 0x...
        value:
          type: string
          description: ETH value to send
          example: '0'
        from:
          $ref: '#/components/schemas/Address'
      required:
        - chainId
        - to
        - data
      description: Transaction data for execution
    SolanaTransactionData:
      type: object
      properties:
        rawTransaction:
          type: string
          description: Base64-encoded Solana transaction
          example: >-
            AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAED...
        serialized:
          nullable: true
          description: >-
            Serialized transaction payload for clients that consume the
            provider-specific shape
      required:
        - rawTransaction
      description: Solana transaction data for execution
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              nullable: true
          required:
            - code
            - message
      required:
        - error
      example:
        error:
          code: QUOTE_NOT_FOUND
          message: Quote not found or expired
    Token:
      type: object
      properties:
        contract:
          $ref: '#/components/schemas/Address'
        symbol:
          type: string
          example: USDC
        decimals:
          type: number
          example: 6
        amount:
          $ref: '#/components/schemas/BigIntLike'
        chainId:
          type: number
          example: 1
        priceUSD:
          type: string
          example: '1.00'
      required:
        - contract
        - symbol
        - decimals
        - amount
        - chainId
      description: Token information with amount and pricing
    SwapFeeBreakdown:
      type: object
      properties:
        chargeableAmountInRaw:
          type: string
        amountInAfterPlatformFeesRaw:
          type: string
        reference:
          $ref: '#/components/schemas/SwapFeeBreakdownReference'
        charges:
          type: array
          items:
            $ref: '#/components/schemas/SwapFeeBreakdownLine'
        summary:
          type: object
          properties:
            platformFeesTotalInRaw:
              type: string
            platformFeesTotalInUSD:
              type: number
            bridgeAndSlippageImpactOutRaw:
              type: string
            bridgeAndSlippageImpactOutUSD:
              type: number
      required:
        - chargeableAmountInRaw
        - amountInAfterPlatformFeesRaw
        - reference
        - charges
        - summary
    SwapFeeBreakdownReference:
      type: object
      properties:
        amountOutRaw:
          type: string
        source:
          type: string
          enum:
            - spotUsdAtQuoteTime
            - unavailable
        pricedAt:
          type: string
          format: date-time
        tokenInPriceInUSD:
          type: number
        tokenOutPriceInUSD:
          type: number
        amountInAfterPlatformFeesRaw:
          type: string
      required:
        - amountOutRaw
        - source
        - pricedAt
        - tokenInPriceInUSD
        - tokenOutPriceInUSD
        - amountInAfterPlatformFeesRaw
    SwapFeeBreakdownLine:
      type: object
      properties:
        kind:
          type: string
          enum:
            - pods
            - customer
            - bridgeAndSlippage
        label:
          type: string
        amountRaw:
          type: string
        decimals:
          type: integer
        symbol:
          type: string
        asset:
          type: string
          enum:
            - tokenIn
            - tokenOut
        amountInUSD:
          type: number
        signed:
          type: boolean
      required:
        - kind
        - label
        - amountRaw
        - decimals
        - symbol
        - asset
        - amountInUSD
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Obtain from your Pods dashboard.

````