Order matching has dropped in Shitcoin Swap in ~100 lines of Ruby.
Most crypto exchanges reach for an existing matching engine or a Uniswap-style AMM. We wrote our own — not because we're smarter, but because the problem is simpler than people think, and understanding every line of your matching logic pays off if things go sideways at 3 AM.
The data model
Two tables, one idea:
Account — holds a balance of one asset. Each user gets one account per asset.






