> For the complete documentation index, see [llms.txt](https://kaspacom.gitbook.io/kaspacom-defi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaspacom.gitbook.io/kaspacom-defi/dex/dex-integration.md).

# DEX Integration

KaspaCom DEX allows seamless token swaps across Kaspa-compatible EVM chains. Integrate it into your application with two flexible options:<br>

## Option 1: SDK Integration (TypeScript)

For advanced or fully custom integrations, use the **KaspaCom Swap SDK** — a lightweight TypeScript library built on top of the Uniswap V2 SDK.

* 🔗 [NPM Package](https://www.npmjs.com/package/@kaspacom/swap-sdk)
* 🔗 [Examples Repository](https://github.com/KASPACOM/swap-sdk-examples)

#### Overview

* Written in **TypeScript** for strong typing and better developer experience.
* Provides easy-to-use tools for implementing swap functionality in wallets or websites.
* Powered by the **Uniswap V2 SDK**.
* Compatible with **custom EVM chains**.
* Supports any external wallet provider implementing **EIP-1193** (e.g., MetaMask, WalletConnect, custom wallets).
* Designed for developers who need flexibility and full control.

### Option 2: Iframe Integration <a href="#option-1-iframe-integration" id="option-1-iframe-integration"></a>

The easiest and fastest way to embed the KaspaCom Swap UI into any website or web app. \
\
🔗 [**Base Iframe URL**](https://defi.kaspa.com/swap) (Mainnet) \
🔗 [**Base Iframe URL**](https://dev-defi.kaspa.com/swap) (Testnet): Use the testnet URL for development and testing purposes.\
\
**URL Parameters**\
Customize the iframe using the following query parameters:

|                  |                                                      |
| ---------------- | ---------------------------------------------------- |
| `inputCurrency`  | Token address the user will swap **from**            |
| `outputCurrency` | Token address the user will swap **to**              |
| `chain`          | **Chain ID** (as a number) of the target EVM network |
| partnerKey       | Please reach out to receive key                      |

✅ **Example**<br>

```html
<iframe
  src="https://defi.kaspa.com/swap?inputCurrency=0x654A3287c317D4Fc6e8482FeF523Dc4572b563AA&outputCurrency=0xD33d07ccfEd8038cEd1aa393FbEf7D7dA72be20e&chain=167012"
  width="100%"
  height="600"
  style="border: none; border-radius: 12px;"
  allow="clipboard-write"
  sandbox="allow-scripts allow-same-origin"
></iframe>
```

This will:

* Load the KaspaCom Swap UI
* Preselect the token pair
* Connect to chain ID `167012` (e.g., **Kasplex Testnet**

### Partner Integration <a href="#getting-started" id="getting-started"></a>

Interested in integrating the **KaspaCom DEX** into your platform or wallet? We can enable a **custom client fee** and provide you with a **partner key**.\
\
👉 Reach out on [**Telegram**](https://t.me/AbiKaspa) to get started.
