Swap Widget
Embed the freaky.fi swap execution interface on your site via iframe or link to it directly.
Overview
The /swap page is a standalone execution interface. It accepts URL parameters to pre-configure the swap and can run in widget mode (no header/footer) for iframe embedding.
Parameters
| Parameter | Description | Example |
|---|---|---|
chain | Chain ID or name | 10, optimism, 8453, base |
sell | Token to sell (symbol or address) | USDC, 0xA0b8... |
buy | Token to buy (symbol or address) | ETH, WETH, 0x6B17... |
amount | Sell amount | 100, 1.5 |
a | Aggregator filter | kyberswap, cowswap, odos |
slippage | Slippage tolerance (0-100) | 0.5, 1 |
widget | Hide header/footer for iframe use | true |
quote | Stored quote ID (from CLI/Telegram) | a1b2c3d4... |
chain, sell, buy, and amount are required unless quote is provided. A stored quote contains all swap parameters.
Direct Link
https://freaky.fi/swap?chain=base&sell=USDC&buy=ETH&amount=100With a specific aggregator:
https://freaky.fi/swap?chain=optimism&sell=USDC&buy=ETH&amount=50&a=kyberswapIframe Embedding
Add widget=true to hide the site header and footer:
<iframe
src="https://freaky.fi/swap?chain=base&sell=USDC&buy=ETH&amount=100&widget=true"
width="480"
height="700"
frameborder="0"
allow="clipboard-write"
/>Execution Flow
The widget guides the user through each step:
- Connect wallet - if not connected
- Switch chain - if wallet is on the wrong network
- Approve - token approval if needed
- Sign - for permit-based swaps (CowSwap, 0x Gasless, Permit2)
- Execute - submit the transaction
The quote refreshes every 30 seconds to stay current.
Stored Quotes
The CLI and Telegram bot can store a quote on the server and generate a /swap?quote=<id> link. Stored quotes preserve the swap configuration (chain, tokens, amount, aggregator) for 30 minutes. The widget fetches a fresh quote on load and refreshes every 30 seconds to keep pricing current.