How to Add a Swap Widget to Your Website and Earn Fees
What an embeddable swap widget is, and why add one
An embeddable swap widget is a small, self-contained trading interface you drop into your own web page with a single iframe. Visitors swap tokens without leaving your site, and the trade routes through real on-chain liquidity in their own wallet. For a token project, a community site or a content creator, it turns a static page into a place where people can actually transact.
There are two reasons to add one. The first is retention: every time you send users to an external exchange, you lose them and the context. Keeping the swap on-page means they stay with you. The second is monetization — the volume that flows through your widget earns you an on-chain referral fee, paid to your wallet. You can see the embeddable swap widget defined in the glossary if you want the short version.
Free, no-code, no API key, non-custodial
Sally's swap widget is free to embed. There is no API key to request, no account to create and no backend for you to run. The builder generates a plain iframe snippet, so adding it is genuine no-code: if you can paste HTML into a page, you can ship it.
It is also non-custodial, which is the part that matters most for trust. The widget never touches your visitors' funds. Every swap is signed from the user's own wallet and settles directly on-chain — you are providing the interface, not holding anyone's money. That keeps your liability low and your users in control.
Practically, that means you are not holding keys and you have nothing to hack. The widget is a front end onto public liquidity; the value never pools anywhere you control. For most site owners that is the whole appeal — all of the utility of an on-page exchange, with none of the operational weight of running one and none of the responsibility of custody.
Step by step: build and paste the embed
Use Sally's swap embed builder to configure the widget and copy the snippet. The whole process is a few minutes:
- Enter the referral address — the wallet that should receive your share of the fees on volume through this widget.
- Choose the chain the widget should default to: Base or BNB Smart Chain.
- Optionally set a default token so the widget opens pre-filled with the asset you care about.
- Adjust appearance and defaults (colors, default slippage) to match your site.
- Copy the generated iframe snippet and paste it into your page where you want the widget to appear.
Auto-resize and a clean fit
A common annoyance with embedded apps is a fixed-height iframe that clips content or leaves an awkward gap. Sally's widget communicates its height to the parent page using postMessage, so the iframe can auto-resize to fit its content as the interface changes — for example when a quote expands or a token list opens.
The result is a widget that sits in your layout like native content rather than a boxed-in frame. You drop in the snippet, and it adapts to its own height without you hand-tuning pixel values.
Customization options
The builder lets you tune the widget to your brand and your audience without writing code. You can adjust colors to match your site, set a default token so the swap opens on the asset you promote, pick the default chain, and set a default slippage tolerance appropriate for the pairs your users trade.
These are sensible knobs rather than an open-ended theming system: enough to make the widget feel like part of your page, while keeping the trading logic and routing handled for you. Set them once in the builder and they are baked into the snippet you copy.
How the referral fee works
Your widget carries your referral address, so when someone swaps through it, you earn half of the protocol fee on that volume. The fee is paid on-chain to your wallet in the native asset — ETH on Base, BNB on BNB Smart Chain — and you can claim it whenever you like. There is no signup and no minimum to start; the address you set is all that is needed.
You can track and claim what you have earned from the referral dashboard. Because the fee is settled on-chain rather than tracked in a private ledger, what you see is what is actually owed to your wallet. There is nothing to reconcile, no payout schedule to wait on, and no account that can be closed — the entitlement lives on-chain under your address.
The same referral mechanism applies to liquidity actions too, not only swaps, so a widget is one of several ways the address you set can earn. If you run multiple sites or campaigns, you can point them all at the same referral address and let the fees accumulate together, or use different addresses to keep them separate. Either way, claiming is on your schedule, not anyone else's.
What it aggregates, and where it runs
Behind the simple interface, the widget is a full DEX aggregator: it sources liquidity across 12+ decentralized exchanges, including Uniswap V2, V3 and V4, Aerodrome and Slipstream, and PancakeSwap, then routes each swap for a competitive price. Your visitors get aggregated pricing without you integrating a single one of those venues.
The widget works on Base and BNB Smart Chain, and renders inside a standard iframe, so it runs on desktop and mobile and inside most site builders and CMS platforms that allow embedded HTML. Configure it once, paste it, and it serves every visitor that lands on the page.
Aggregating across that many venues is what makes the prices competitive: rather than tying your users to a single pool that might be thin for their pair, the router compares routes and picks the best one available at trade time. Your visitors do not have to know any of that — they pick two tokens and an amount, and the widget handles the routing while they keep control of their funds in their own wallet.