Embed the swap widget
Put SwapChan's swap card on your site: every aggregator and bridge we compare, every chain including Solana, Bitcoin and Tron, wallet connect inside the widget. Users never leave your page. Register as a partner and you earn 50% of SwapChan's 0.1% fee on swaps through your widget. The user pays the same either way. Estimate your earnings.
<script src="https://swapchan.com/widget.js" async></script>
Live preview
Options
| widget.js attribute | iframe param | What it does |
|---|---|---|
| data-partner | partner | Your partner id (revenue share) |
| data-from-chain / data-to-chain | fromChain / toChain | Chain id, e.g. 1, 8453, 792703809 (Solana) |
| data-from-token / data-to-token | fromToken / toToken | Token address or mint |
| data-amount | amount | Prefilled amount, e.g. 100 |
| data-theme | theme | dark (default) or light |
| data-accent | accent | Button color, e.g. #22c55e |
| data-chan | chan | 0 hides Swap-chan and the chain characters |
| data-compact | compact | 1 = shorter card, best route only |
| data-lock-to | lockTo | 1 = destination can't be changed ("buy our token") |
| data-target | CSS selector to mount into (default: where the script is) | |
| data-width | iframe width (default 420px) |
Events
The widget posts {source: "swapchan", type, ...} to your page for ready, quote, swap_submitted (with txHash), swap_completed and resize. With widget.js you can also listen for a swapchan event on window:
window.addEventListener("swapchan", (e) => {
if (e.detail.type === "swap_completed") console.log("swapped via", e.detail.provider);
});React
An @swapchan/widget React package is coming. Until then, render the iframe snippet from above as JSX. It's the same widget.
Affiliate links
No widget needed: add ?ref=your-id (or ?partner=) to any swapchan.com link, e.g. https://swapchan.com/?ref=your-id, a /swap/… route, a pre-filled deep link or /scanner. The id is kept in a first-party cookie for 30 days (last click wins; visits without a ref don't clear it), and quotes and swaps on the main site earn the same share under the same rules. AI agents can pass partner to the MCP quote tools; their swap links then carry your ref.
Revenue share
- The total fee stays 0.1% (10 bp). You get half of what SwapChan actually earns on each swap.
- Only swaps where the provider confirmed our fee count. Swaps from your own payout address don't.
- Your earnings accrue on your private dashboard and are paid periodically in USDC to your payout address.