Embed swap.my anywhere
A drop-in iframe for any site. Cross-chain swaps with zero backend work. Earn a revenue share on every swap your visitors make.
- 1Get your code
Sign up and grab your referral code from your account page. That code is also your partner ID for embedding.
- 2Paste the iframe
Use the snippet generator below. Pick your default currencies, theme and size, then copy the snippet into your site.
- 3Earn on every swap
Every swap through your widget is attributed to your code. You earn a cut of the fee, withdrawable in USDT, USDC, ETH or SOL.
Configure
Without a code, swaps still work but you won't earn attribution.
Embed snippet
<iframe
src="https://swap.my/embed?from=USDC&fromNetwork=base&to=ETH&toNetwork=ethereum"
width="420"
height="560"
style="border:0;border-radius:16px;overflow:hidden"
allow="clipboard-write"
title="swap.my widget"
></iframe>Live preview
Open This is the actual widget loaded from /embed. What you see here is what your visitors will see.
postMessage events
The widget emits events to the parent window. Listen for them to react to widget state in your app.
window.addEventListener("message", (event) => {
if (event.origin !== "https://swap.my") return;
const { type, payload } = event.data || {};
switch (type) {
case "swapmy:ready":
// Widget loaded, currencies fetched
break;
case "swapmy:quote":
// payload: { fromAmount, toAmount, rate }
break;
case "swapmy:order-created":
// payload: { orderId, depositAddress, statusUrl }
// The widget also opens statusUrl in a new tab automatically
break;
case "swapmy:error":
// payload: { code, message }
break;
}
});How earnings work
- Every swap that starts in your widget gets your partner code attributed on the order.
- When the swap completes, you earn a share of the platform fee, paid into your account balance.
- Withdraw anytime in USDT, USDC, ETH or SOL from your account page.
- Custom rates are available for high-volume partners. Reach out via support.