Picture an airport with a row of currency exchange booths. Every booth posts its own rate, and the rates change every few seconds. You could walk the row yourself. By the time you reach the last booth, the first one has changed.
So you hire a runner. The runner checks every booth at once and comes back with the best deal. Sometimes the best deal is split across two booths.
You give the runner one instruction before they go: if the rate gets worse than this, cancel. That limit is called slippage.
That's a token swap, and the runner is Jupiter. For Deed #4 we built a web page that asks Jupiter for a price, has your wallet sign once, and then tells you plainly how it ended. Deed #3 let two strangers trade through a locker nobody holds the key to. This one trades against the whole market, and for the first time in the series it ran on mainnet with real money: 0.01 SOL.
Watch the Deed #4 demo on YouTube.
Where the airport stops being true
At a real booth you can hand over your cash and get short-changed. On Solana you sign one slip, and either the whole exchange happens or none of it does. There's no state where your SOL has left and the USDC hasn't arrived.
That's the property the page leans on. Whatever happens after you sign, there are only a few ways it can end, and the page's job is to say which one.
How do you keep the key out of the browser?
To ask Jupiter for prices, the page needs an API key. Think of it as a password for a program: it tells Jupiter who is asking. You make one on Jupiter's developer site. Open API keys, press create, give it a name and choose a server key. Jupiter shows the full key once.
A key in browser code is a key anyone can read. So the browser never sees ours.

The browser asks our own server, and the server asks Jupiter. The server also refuses anything the page doesn't need. It accepts five tokens, whole-number amounts and a slippage between 0.01% and 10%. Without that, anyone could use our key to make any Jupiter call they liked.
The swap, and the number that looked wrong
A quote shows what you'd receive, how much your trade would move the price, and which exchange it would go through. It refreshes every ten seconds, because an old price is a wrong price. If it can't be refreshed for thirty seconds the page withdraws it.
Then I did it for real. I typed 0.01 SOL, the page estimated 0.684628 USDC, I pressed swap and approved it in my wallet. A few seconds later: swap complete, 0.684945 USDC received. Slightly more than the estimate.
The transaction is on Solana's explorer, finalized. The network fee was 0.000022051 SOL.
When I read the transaction back from the chain, the amount wasn't 0.684945. It was 684945.
A blockchain doesn't store decimal points. It counts whole units. Each token declares how many decimal places it has, and USDC declares six. Move the point six places and 684945 becomes 0.684945 USDC. About 68 cents.
The page does the same arithmetic in the other direction when you type an amount. It uses whole numbers throughout, because ordinary computer arithmetic gets decimal fractions slightly wrong.
What can happen after you sign?
The page names six endings.
| Ending | Seen for real? |
|---|---|
| Swap complete, with the signature and the amount received | Yes |
| You rejected it in your wallet | Yes |
| The quote expired | Tests only |
| The price moved past your slippage limit | Tests only |
| It failed, with Jupiter's reason | Tests only |
| We could not confirm the result | Tests only |
I rejected a swap on camera. The page said so, said nothing was signed or sent, and one click got a fresh quote.
The expired and slippage endings I haven't seen for real. They're covered by tests that use a pretend wallet and answers written from Jupiter's documentation.
The last ending wasn't in the plan. If the answer gets lost after you've signed, the page can't know whether the swap landed. If it said "failed" and was wrong, you might swap twice. So it asks again about the same signed transaction, which can't execute twice, and it never asks your wallet to sign again.
Why let Jupiter land it
Jupiter offers two ways in. I used the managed one: Jupiter builds the transaction and lands it, so the page needs no Solana node of its own. All of Jupiter's routers compete on the price.
The other way hands you the raw instructions. Pick that one if you need to add your own steps to the transaction, or want to avoid Jupiter's swap fee. You then do the sending and confirming yourself.
What the real swap caught
The page had 45 passing tests when I made the swap. After "swap complete", the quote the swap had started from was still on screen above the result, counting up its age. Left long enough it would have said "Expired" over a completed swap.
No test looked at the quote after a swap ended. The bug showed up in the screen recording of the real one. It's fixed, and there's a test for it now.
Other things went wrong on the way:
- Claude Code's first live call used a USDC address written from memory. Jupiter answered that it was "not a valid token mint". The addresses now come from Jupiter's own token list.
- With slippage on automatic, the page showed a "minimum received" that was just the estimate repeated. Jupiter only sets the limit when it builds the transaction, so the page now says that.
- The secret scanner flagged five public pool addresses because the field is called
ammKey. The first exception written for it was too wide: it would have let a real secret through in the same files. Testing the exception caught that.
Why did a four-minute video take six cuts?
Deed #3 ended by saying Deed #4 would be the test of the playbook. It got us from "begin" to a narrated video in a day. The video needed the most correcting, and I found most of the faults by watching each cut.
My screen was recorded for three takes while I did the work: making the API key, the real swap and the rejection. Claude Code cut them into scenes. The key on screen is covered, and I deleted it after recording.
Then came six cuts. Captions covered the swap button. The proof scene named an amount its picture didn't show, because the screenshot was taken before the page finished loading. The rejection scene said "one click gets a fresh quote" several seconds before the footage showed one. One scene ran four seconds past the end of my sentence. Captions appeared twice.
I narrated every scene myself in the voice booth. A synthetic voice read the drafts so I could review the words; it isn't in the published video.
What's still open
One real swap and one real rejection. The other four endings have only run in tests.
The page doesn't check your balance before quoting. If you don't have the funds, you find out when you press swap, before anything is signed.
It runs on my laptop. There's no hosted version. The source is public as a snapshot; the build journal and issue history stay private.
The page asks your wallet to sign whatever Jupiter returns. It doesn't decode the transaction first. Your wallet's own preview is the check.
Deed #5 is a stablecoin checkout.