Why we simulate every trade before running it
Reserves can look fine and a trade can still fail. Here is why Sherwood runs every order against the chain first.
When you press buy in Sherwood, the trade does not go straight to the chain. It gets simulated first — run against current chain state to see what would actually happen — and only executed if that simulation succeeds. This post explains why that extra step is worth it.
The trap: signals that lie
The obvious way to decide whether a trade will work is to read the pool: check the reserves, check whether trading is open, do the math. It feels rigorous. It is also unreliable.
We learned this the hard way. Reserves looked healthy and a trade still reverted. Trading restrictions that should have lifted read one way and behaved another. Every individual signal we trusted eventually lied to us in some case, because a token's real behaviour depends on its actual contract code — code that can do things no generic pool reader anticipates.
The fix: ask the chain, not a proxy
Simulation sidesteps all of that. Instead of predicting whether a trade will succeed from a handful of signals, Sherwood asks the chain the exact question — if I ran this trade right now, what happens? — and gets back the real answer, including the real output amount and any revert.
If it would fail, you are told before any gas is spent. If it would succeed, the numbers you see on the confirmation card are the numbers the chain just produced, not an estimate.
Why it matters to you
- No gas wasted on doomed trades. A trade that would revert is stopped at the quote, not discovered after you have paid to fail.
- Honest numbers. The expected output is a simulation result, not a guess, so what you approve is what you get, within your slippage tolerance.
- Fewer nasty surprises. Tokens with unusual transfer logic reveal themselves during simulation instead of after you have bought in.
Simulation is not glamorous and you never see it happen. That is the point — it works quietly so that the confirm button means what it says.
Read more about the trade flow in Buying and selling.