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

# App Kit SDK: Swap

> Swap stablecoins and native tokens with the App Kit SDK's Swap capability

The [App Kit SDK](/app-kit) includes the Swap capability that lets you swap two
tokens in a few lines of code. Swap
[supports](/app-kit/references/supported-blockchains#supported-tokens) many
stablecoins (including USDC, EURC, USDT, USDe, DAI, and PYUSD) and native tokens
on supported blockchains. You need a (free)
[kit key](https://developers.circle.com/w3s/keys#kit-keys) from the
[Circle Console](https://console.circle.com) to use Swap.

<Note>
  Among testnets, only Arc Testnet supports Swap (USDC, EURC, and cirBTC only).
  Use mainnet for Swap on any other blockchains.
</Note>

## Quick look

<Tabs>
  <Tab title="Same-chain swap">
    This example swaps 1 USDC for EURC on Arc Testnet:

    ```typescript TypeScript theme={null}
    const result = await kit.swap({
      from: { adapter: viemAdapter, chain: "Arc_Testnet" },
      tokenIn: "USDC",
      tokenOut: "EURC",
      amountIn: "1.00",
      config: {
        kitKey: process.env.KIT_KEY as string, // Your kit key from the Circle Console
      },
    });
    ```

    See [Swap tokens on a blockchain](/app-kit/quickstarts/swap-tokens-same-chain)
    for a full working example.
  </Tab>

  <Tab title="Crosschain swap">
    This example swaps 1 USDC on Base for native POL delivered on Polygon in a
    single call:

    ```typescript TypeScript theme={null}
    const result = await kit.swap({
      from: { adapter: viemAdapter, chain: "Base" },
      tokenIn: "USDC",
      tokenOut: "NATIVE",
      amountIn: "1.00",
      to: {
        chain: "Polygon",
        recipientAddress: "0xYourRecipientAddress",
      },
      config: {
        kitKey: process.env.KIT_KEY as string,
      },
    });
    ```

    See
    [Swap tokens across blockchains](/app-kit/quickstarts/swap-tokens-crosschain)
    for a full working example.
  </Tab>
</Tabs>

## Installation

[Install the App Kit SDK](/app-kit/tutorials/installation) to use Swap. If you
only need to swap and don't want to install the full App Kit SDK, install the
standalone Swap Kit for your preferred adapter below.

<Tabs>
  <Tab title="Viem">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @circle-fin/swap-kit @circle-fin/adapter-viem-v2 viem
      ```

      ```bash yarn theme={null}
      yarn add @circle-fin/swap-kit @circle-fin/adapter-viem-v2 viem
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Ethers">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @circle-fin/swap-kit @circle-fin/adapter-ethers-v6 ethers
      ```

      ```bash yarn theme={null}
      yarn add @circle-fin/swap-kit @circle-fin/adapter-ethers-v6 ethers
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Solana">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @circle-fin/swap-kit @circle-fin/adapter-solana-kit @solana/kit @solana/web3.js
      ```

      ```bash yarn theme={null}
      yarn add @circle-fin/swap-kit @circle-fin/adapter-solana-kit @solana/kit @solana/web3.js
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Circle Wallets">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @circle-fin/swap-kit @circle-fin/adapter-circle-wallets
      ```

      ```bash yarn theme={null}
      yarn add @circle-fin/swap-kit @circle-fin/adapter-circle-wallets
      ```
    </CodeGroup>
  </Tab>
</Tabs>
