What a swap on Cookie Chain actually costs you — measured at eight sizes before you sign it, and against what you were promised after it lands.
Cookie Chain holds 160 pools and about $7,880 of liquidity in total; 147 of those pools hold under $100. At that depth the cost of a trade is not a rounding error on it — it is it. So the first thing cookiefill reports is the size at which a pool stops being worth trading.
| trade size | cost | |
|---|---|---|
| $0.11 | 0.0 bps | |
| $1.12 | 25.6 bps | |
| $5.59 | 138.7 bps | |
| $11.18 | 280.0 bps | |
| $27.95 | 703.7 bps | |
| $55.90 | 1,409.5 bps | |
| $111.80 | 2,819.4 bps | |
| $223.61 | 5,634.9 bps |
A trade small enough to leave the pool where it found it pays the fair price. Everything above that pays more, and the gap is the cost. The reference here is the router's own quote at 1,000 COOK, about eleven cents — and it is used only when the router itself reports that this size moved the pool by less than 0.1%.
This is the construction published for Solana as solana-exec-bench, where the reference was the median realized price of trades under $100 in the same minute on the same pair. That needs other people's fills. Cookie Chain has no such flow, so the reference comes from quotes — and the app then measures the fill afterwards to check the quote against what actually settled.
null as 0.The app connects a wallet through the Wallet Standard, has Nightly point itself at Cookie Chain by genesis hash, asks the Cookiebox router to build the swap, hands the unsigned transaction to the wallet, sends it, confirms it, and then reads the confirmed transaction back to price the fill. No key ever reaches the app.
471p61hLUPv2GYxW6MEEev3vSRxDj7R1baLMSCWnSbxUg1LKF1iKye5uBdEF2jzn3T8FRoEGDgy6XkWbmgq7bzet
The swap succeeded on chain. The receipt did not — it reported a cost of:
Neither function was wrong on its own. The curve engine quoted its ladder in whole COOK; the fill engine reads raw transaction balances in base units. The two prices sat 10⁹ apart, and all seventeen unit tests passed anyway, because every one of them stayed inside a single module and every module was consistent with itself.
Crossing them against one real transaction is what caught it. The unit is now declared in the type rather than assumed, and the numbers from that exact transaction are pinned as a regression test. A test that never crosses a module boundary does not test the contract between modules.
Simulation is read-only — it never broadcasts and never moves a balance, so the swap path can be proven with no funds and no private key. Any funded address works as the fee payer the router builds for.
| required | status | evidence |
|---|---|---|
| Built on Cookie Chain (SVM) | done | RPC, router and pool data are all Cookie Chain; genesis 9wDaBRDg…EcBB2 |
| Wallet connection, Nightly supported | done | Wallet Standard, plus an explicit network switch by genesis hash |
| Display connected wallet address | done | Address and live COOK balance, read from Cookie Chain |
| Transaction execution | done | 471p61hL…q7bzet, confirmed at slot 23,438,162 |
| Transaction confirmation handling | done | Narrated step by step: build, sign, send, confirm, measure |
| Error handling and user feedback | done | The router's own reason, in plain language, before the click and after it |
| Analytics, charts or dashboards | done | The eight-size cost ladder, and the size ceiling it implies |
| Uses existing Cookie Chain programs | done | Cookiebox aggregator for quotes and swap construction |
| Deployed and publicly accessible | done | cookie-fill.vercel.app, no login, no wallet needed to read |
| Open source with a README | done | MIT, with the method and this bug written up in full |
| Demo thread on X | done | @Cristiankzk1 — what it does, how to use it, and the route to the bridge |
It deploys no program of its own — it composes on top of Cookie Chain's existing ones through the Cookiebox router, which is why the addresses that matter are theirs, not a new one. It quotes only COOK-denominated pairs. And it will not compare your fill against other traders' fills, because on a chain with $7,880 of total liquidity there are not enough of them for that comparison to mean anything. That is stated on the page rather than papered over.