---
title: "POST /execute/swap"
method: POST
path: "/execute/swap"
---

# POST /execute/swap

`POST /execute/swap`

## Request body

- object
  - `user` string, required — Address that is depositing funds on the origin chain and submitting transactions or signatures
  - `recipient` string — Address that is receiving the funds on the destination chain, if not specified then this will default to the user address
  - `originChainId` number, required
  - `destinationChainId` number, required
  - `originCurrency` string, required
  - `destinationCurrency` string, required
  - `amount` string, required — Amount to swap as the base amount (can be switched to exact input/output using the dedicated flag), denoted in the smallest unit of the specified currency (e.g., wei for ETH)
  - `tradeType` 'EXACT_INPUT' | 'EXACT_OUTPUT' | 'EXPECTED_OUTPUT', required — Whether to use the amount as the output or the input for the basis of the swap
  - `txs` object[]
    - `to` string
    - `value` string
    - `data` string
  - `source` string
  - `refundTo` string — Address to send the refund to in the case of failure, if not specified then the recipient address or user address is used
  - `refundOnOrigin` boolean — Always refund on the origin chain in case of any issues
  - `useExternalLiquidity` boolean — Enable this to use canonical+ bridging, trading speed for more liquidity
  - `useFallbacks` boolean — Enable this for specific fallback routes
  - `usePermit` boolean — Enable this to use permit (eip3009) when bridging, only works on supported currency such as usdc
  - `slippageTolerance` string — Slippage tolerance for the swap, if not specified then the slippage tolerance is automatically calculated to avoid front-running. This value is in basis points (1/100th of a percent), e.g. 50 for 0.5% slippage
  - `appFees` object[]
    - `recipient` string — Address that will receive the app fee
    - `fee` string — App fees to be charged for execution in basis points, e.g. 100 = 1%

## Response `200`

Default Response

- object
  - `steps` object[] — An array of steps detailing what needs to be done to bridge, steps includes multiple items of the same kind (signature, transaction, etc)
    - `id` string — Unique identifier tied to the step
    - `action` string — A call to action for the step
    - `description` string — A short description of the step and what it entails
    - `kind` string — The kind of step, can either be a transaction or a signature. Transaction steps require submitting a transaction while signature steps require submitting a signature
    - `requestId` string — A unique identifier for this step, tying all related transactions together
    - `items` object[] — While uncommon it is possible for steps to contain multiple items of the same kind (transaction/signature) grouped together that can be executed simultaneously.
      - `status` string — Can either be complete or incomplete, this can be locally controlled once the step item is completed (depending on the kind) and the check object (if returned) has been verified. Once all step items are complete, the bridge is complete
      - `data` unknown
      - `check` object — Details an endpoint and a method you should poll to get confirmation, the endpoint should return a boolean success flag which can be used to determine if the step item is complete
        - `endpoint` string — The endpoint to confirm that the step item was successfully completed
        - `method` string — The REST method to access the endpoint
  - `fees` object
    - `gas` object — Origin chain gas fee
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `relayer` object — Combination of the relayerGas and relayerService to give you the full relayer fee
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `relayerGas` object — Destination chain gas fee
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `relayerService` object — Fees paid to the relay solver, note that this value can be negative (which represents network rewards for moving in a direction that optimizes liquidity distribution)
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `app` object — Fees paid to the app. Currency will be the same as the relayer fee currency. This needs to be claimed later by the app owner and is not immediately distributed to the app
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `subsidized` object — The amount of fees for the request that are subsidized by the request sponsor. Does not include deposit origin gas unless it is a permit based deposit.
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
  - `breakdown` object[]
    - `value` string — Amount that will be swapped in the estimated time
    - `timeEstimate` number — Estimated swap time in seconds
  - `balances` object
    - `userBalance` string — The user's balance in the given currency on the origin chain
    - `requiredToSolve` string — The minimum balance the user needs to have to swap
  - `details` object — A summary of the swap and what the user should expect to happen given an input
    - `operation` string — The operation that will be performed, possible options are send, swap, wrap, unwrap, bridge
    - `timeEstimate` number — Estimated swap time in seconds
    - `userBalance` string — The user's balance in the given currency on the origin chain
    - `sender` string — The address that deposited the funds
    - `recipient` string — The address that will be receiving the swap output
    - `currencyIn` object
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `currencyOut` object
      - `currency` object
        - `chainId` number
        - `address` string
        - `symbol` string
        - `name` string
        - `decimals` number
        - `metadata` object
          - `logoURI` string
          - `verified` boolean
          - `isNative` boolean
      - `amount` string
      - `amountFormatted` string
      - `amountUsd` string
      - `minimumAmount` string
    - `totalImpact` object — The difference between the input and output values, including fees
      - `usd` string
      - `percent` string
    - `swapImpact` object — The impact of the swap, not factoring in fees
      - `usd` string
      - `percent` string
    - `rate` string — The swap rate which is equal to 1 input unit in the output unit, e.g. 1 USDC -> x ETH. This value can fluctuate based on gas and fees.
    - `slippageTolerance` object
      - `total` string — The total slippage tolerance applied to the order, in basis points (1/100th of a percent), e.g. 50 for 0.5% slippage. The origin and destination breakdowns are alternative allocations of this budget and are not additive.
      - `origin` object — The slippage tolerance on the origin chain swap
        - `usd` string
        - `value` string
        - `percent` string
      - `destination` object — The slippage tolerance on the destination chain swap
        - `usd` string
        - `value` string
        - `percent` string

## Other responses

- `400` — Default Response
- `401` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/relay/apis/cross-chain-solver.md) · [All operations](https://skmtc.net/relay/apis/cross-chain-solver/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/relay/cross-chain-solver/versions/428d669c2830/schema)
