Embed a Self-Custody Solana Swap on Any Site with the SOLbin Widget

One Line of HTML, a Full Solana Swap
If you run a crypto site, a token dashboard, a community page, or any product where users might want to swap Solana tokens, you usually face a choice: send them away to an exchange (and lose them), or build a swap integration yourself (weeks of work, plus key-management liability).
The SOLbin swap widget is a third option. Paste one iframe tag into your page and your users get a production-grade Solana swap powered by Jupiter, the leading Solana DEX aggregator — without your site ever touching a private key.
<iframe
src="https://solbin.fun/embed/swap?network=solana"
width="420"
height="640"
frameborder="0"
style="border:none;border-radius:16px;overflow:hidden;background:#1a1d22;"
title="SOLbin Swap"
></iframe>
That's it. No SDK to install, no API key to manage, no backend to deploy. You can configure and preview your embed in seconds.
What the Widget Actually Does
Under the hood, the widget is the same Jupiter swap engine that powers SOLbin's own DApp browser. Here's the full flow, step by step.
1. The user connects their own wallet
When the iframe loads, the user sees a Connect button. They click it and approve the connection in their wallet — Phantom, Solflare, or any Solana-compatible extension that's injected into the page. SOLbin's native wallet (PIN-unlocked keystore) also works if the user is signed into SOLbin inside the iframe.
The connection happens between the user and the widget. Your host website is never in the loop, never sees the connection, and never receives the public key. This is enforced by browser same-origin policy: the iframe runs on smart-chain-vault.base44.app, so it's fully sandboxed from your page.
2. Balances are read on-chain
Once connected, the widget reads the user's SOL balance and the SPL token balance of the selected input token directly from Solana RPC. These are public on-chain reads — no private key is needed to fetch a balance. The widget refreshes balances after every trade so the user always sees their current spendable amount.
3. A live Jupiter quote is fetched
As the user types an amount, the widget debounces and calls Jupiter's quote API for the best available route across all Solana DEXs — Raydium, Orca, Meteora, pump.fun AMMs, and more. The user sees the expected output amount in real time, with slippage protection applied (1% default).
4. The user signs locally
When the user clicks Swap, Jupiter returns a sealed VersionedTransaction. The widget passes it to the user's wallet for signing. The signature happens in the user's wallet extension — the private key never leaves the user's device. SOLbin and your site never see it.
5. The transaction is broadcast
After signing, the widget broadcasts the signed transaction to Solana and shows the user a confirmation link to Solscan. Balances refresh automatically once the swap lands.
Self-Custody by Design
This is the most important point, so it's worth repeating: your site never touches keys, funds, or signatures.
- The iframe is sandboxed by the browser's same-origin policy. Your page cannot read the wallet, and the widget cannot read your page's wallet or cookies.
- The user connects their wallet inside the widget — the same as connecting to any dApp.
- Every swap is signed locally in the user's wallet extension.
- SOLbin and your site never hold, route, or custody user funds.
This means you get the engagement of an in-page swap without the legal, security, and operational burden of custody. There's nothing for an attacker to steal from your site, because your site never has the keys.
Configuring the Embed
The widget accepts two query parameters:
| Parameter | Required | Description |
|---|---|---|
| network | No | The swap chain. Currently solana (Jupiter). Defaults to solana. |
| token | No | A Solana mint address to pre-select as the buy token. If omitted, defaults to JUP. |
The token parameter is the most useful one. If your page is about a specific token — a token dashboard, a launch announcement, a community site — pass that token's mint address and the widget opens with it already selected as the destination. The user just picks how much SOL to spend and swaps.
Example: pre-select a token by mint
<iframe
src="https://smart-chain-vault.base44.app/embed/swap?network=solana&token=JUPyiwr...DvCN"
width="420"
height="640"
frameborder="0"
style="border:none;border-radius:16px;overflow:hidden;background:#1a1d22;"
title="SOLbin Swap"
></iframe>
You can set the width and height to fit your layout. The widget is responsive and works in sidebars, modals, or full-width sections.
Platform Fees
A small platform fee is applied to SOL-input swaps and routed to the SOLbin treasury. This is how the widget stays free for partners and users. The fee is transparently shown in the swap UI before the user confirms. Token-to-token swaps route gas from the user's SOL balance normally.
During SOLbin promotions (like Wild Wild West Week), platform fees can be set to 0% across the entire app, including the embed.
Who Is This For?
- Token dashboards and analytics sites — let visitors buy the token they're researching without leaving your page.
- Community sites and DAOs — give your community a one-click swap into your token.
- Content creators and newsletters — embed a swap under a token review so readers can act immediately.
- Portfolio trackers — let users rebalance without bouncing to an exchange.
- Any Solana-focused product that wants to increase time-on-site and reduce drop-off to external exchanges.
Getting Started
- Open the developer embed page.
- Optionally enter a token mint to pre-select.
- Copy the generated iframe code.
- Paste it into your site's HTML.
That's the whole integration. No signup, no API key, no backend. The widget is live the moment the iframe renders.
FAQ
Can the host site read the user's wallet balance? No. The iframe is sandboxed by same-origin policy. The host page cannot access the wallet, the public key, or any data inside the widget. The connection is strictly between the user and SOLbin's widget.
Can the host site customize the widget's appearance? Currently the widget ships with SOLbin's dark cyberpunk theme. You control the iframe dimensions and the pre-selected token via query params. Further theming is on the roadmap.
Does the host site need to be a SOLbin user? No. The widget works without authentication. Any visitor with a Solana wallet extension can connect and swap.
What wallets are supported? Any wallet that injects a Solana provider into the iframe (Phantom, Solflare, Backpack, etc.) plus SOLbin's native PIN-unlocked keystore if the user signs into SOLbin inside the widget.
Is there a fee for using the embed? The embed is free for partners. A small platform fee on SOL-input swaps routes to the SOLbin treasury. There is no cost to embed, no API key, and no usage limit.
The SOLbin swap widget is the fastest way to put a self-custody Solana swap on your site. Generate your embed code and paste it in — your users get a real swap, you get the engagement, and nobody has to trust anybody with their keys.