Swap embed builder
Embed a multi-DEX swap widget on your website (Base & BNB Chain) and earn referral fees. Configure it below, preview it live, and copy the iframe. Every swap routed through it pays your wallet 50% of the protocol fee. Non-custodial — users sign in their own wallet.
Paste any ERC-20 to set it as the default receive token. Users can also add any custom token live inside the widget (paste an address in the token picker — symbol/decimals are read on-chain). Pair this with a custom V4 hook below to onboard liquidity for your token.
Hooks are pool-level — the swap router auto-selects pools and ignores hooks(verified on-chain). The hook is pre-filled when a user opens a V4 liquidity position from the widget's settings.
<!-- Sally swap widget -->
<iframe
src="https://sally.tools/embed/swap?chainId=8453&outToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
title="Sally Swap"
width="100%"
height="600"
style="border:0;border-radius:16px;max-width:440px"
allow="clipboard-write; web-share; payment"
loading="lazy"
></iframe>
<script>
// Optional: auto-size the iframe to its content.
addEventListener('message', e => {
if (e.data?.type === 'sally:resize')
document.querySelector('iframe[title="Sally Swap"]').style.height = e.data.height + 'px'
})
</script>Non-custodial. Wallet support: Coinbase + WalletConnect work in any cross-origin iframe; injected (MetaMask) works same-origin. See the wallet notes in the docs.
All URL parameters
Append to https://sally.tools/embed/swap?…. Every param is optional; the builder above writes them for you.
refopaque slugYour referral — earns 50% of the protocol fee on every swap. The builder encodes your wallet into a slug so the raw address never appears in the embed. Sticky per visitor.chainId8453 | 56Initial chain (Base | BSC). Applied even for disconnected visitors; users can still switch.outToken0x… addressDefault "You receive" token — e.g. your project token.inToken0x… addressDefault "You pay" token (defaults to the native token).amountdecimalPre-fill the input amount.slippage0.05 – 50Default slippage % (else 0.5).deadline1 – 180Tx deadline in minutes (else 20).bgtransparentTransparent widget background so it blends into your page.accenthex (no #)Brand accent color, e.g. accent=7c5cff — recolors the whole widget.v41Bias routing toward Uniswap V4 when output is within 1% of best.hook0x… addressCustom V4 hook. Pre-fills the user’s V4 liquidity adds (swaps ignore hooks — verified on-chain).Set a default with outToken, OR let users paste anyERC-20 address in the widget's token picker — symbol, decimals and logo resolve on-chain, no list required.
The widget posts {type:'sally:resize',height} to the parent as content grows (route list, modals). The snippet above includes the listener.
Coinbase (keyless popup) + WalletConnect (QR/deeplink) work cross-origin. Injected (MetaMask) needs same-origin. Don't over-sandbox: allow allow-popups allow-scripts allow-forms allow-same-origin.
Swaps auto-route and ignore hooks (the router decodes only fee+tickSpacing — verified on-chain). A custom hook applies when a user opens a V4 liquidity positionfrom the widget's settings.
Swap widget FAQ
Adding Sally's free, non-custodial multi-DEX swap widget to your site — and earning from it.