Serum matched token trades through an on-chain order book on Solana
Serum was a decentralized exchange on Solana whose on-chain order book matched buyers and sellers at compatible prices. Order-entry interfaces offered price and quantity controls, while swap applications simplified token exchange using the same order-book infrastructure. A limit order specified the price and quantity a trader would accept. Following the collapse of FTX and Alameda Research in November 2022, its original mainnet program became defunct. OpenBook continued the order-book approach as a separately deployed community fork.
Trading interfaces and a shared market book
Trading interfaces connected users to market books the exchange program maintained on Solana. Applications accessing the same market shared its orders; different markets had their own liquidity.
Order-entry interfaces
Order-entry interfaces displayed bids, asks, and recent fills, alongside controls for placing or cancelling orders. This format exposed the price and size choices familiar from centralized exchanges. Wallet signatures authorized on-chain instructions, and the matching program applied the market rules. An accepted order could remain open when no compatible counterparty existed.
Swap applications
Swap applications presented token exchange through a simpler input-and-output interface. The dedicated Swap program combined order-book trading with settlement inside an application call. Its liquidity came from standing orders. Pool-based automated market makers used reserve-based pricing, while the underlying DEX matched quoted bids and asks. A swap-style screen alone did not identify its liquidity mechanism.
Program integrations
Program integrations accessed the same exchange functions through client libraries and on-chain calls. Developers could read market depth, retrieve fills, and manage orders. This made the protocol useful as shared trading infrastructure beyond a single website, with execution still constrained by the selected market's liquidity and permissions.
Limit prices, depth, and partial fills
Limit orders constrained execution prices, while the opposite side of the book determined how much could trade immediately. A buy limit set the highest acceptable price; a sell limit set the lowest. The spread separated the best standing bid and ask, and available quantities at acceptable prices constrained execution size.
Immediate-or-cancel orders could execute against available liquidity without leaving their unfilled quantity on the book. Post-only orders could add standing liquidity without taking existing orders. A standard limit order could combine an immediate fill with a resting remainder. These settings governed order behavior, independently of the interface's visual layout.
An accepted order with an unfilled remainder
In this hypothetical legacy-market example, an accepted standard limit buy specified a price and quantity, with enough quote tokens for execution and fees. Acceptable sell orders covered only part of the requested quantity. With sufficient processing capacity and space for the remaining order, matching bought the available portion and posted the rest. The account therefore recorded a partial purchase and an outstanding bid. Additional selling interest at compatible prices was necessary to complete the order.
Market vaults, OpenOrders, and settlement
Market vaults held trading tokens, while OpenOrders accounts recorded each owner's orders and associated balances for a particular market. The base token was the asset traded; the quote token priced it.
Available and committed balances
An OpenOrders account distinguished total balances from free amounts available for settlement. Tokens committed to resting orders remained unavailable for withdrawal through settlement. Matching and account updates changed these balances. An unsettled balance recorded tokens still held in market vaults and available for settlement to a destination token account.
Serum V3 could match orders during placement. Event-consumption instructions, often called cranking, processed queued records affecting participating order accounts. Matching and event processing had distinct roles, without requiring a universal sequence of separate user transactions.
Transfers back to token accounts
Settlement transferred free balances from market vaults into destination token accounts using owner authorization. Some integrations combined trading and settlement, so a separate settlement button was an interface choice. A fill recorded execution; the transfer returned available tokens to the designated accounts.
The Serum V3 repository's main branch implemented SendTake for immediate-or-cancel trades with direct token transfers, while release v0.5.4 left its handler unimplemented. The implemented path did not require the taker's own OpenOrders account. Its limit price and minimum-output checks constrained execution, making a later manual settlement step unnecessary for those direct transfers.
SRM utility and the exchange economy
SRM was the ecosystem's utility and governance token, with fee-discount roles in the legacy DEX. Its native representation used Solana's SPL token standard; an ERC-20 representation also existed on Ethereum. MegaSerum (MSRM) represented 1,000,000 SRM locked together in the original token design. Fee-funded purchases and burns of SRM belonged to that economic design. Those token mechanisms were separate from matching orders and settling market balances.
Trading fees and account funding
Serum's trading costs included execution charges, Solana transaction fees, and funding for newly created accounts where needed. Makers supplied standing orders; takers executed against them. The legacy fee system distinguished those roles and incorporated qualifying SRM or MSRM balances where supported. An application could impose an additional charge, making its total trading cost distinct from the protocol fee alone.
Account funding supported stored on-chain data. Creating an OpenOrders account required SOL for rent exemption, separate from the transaction fee paying for network processing. Account size and applicable rent rules determined the required funding.
Why did Serum give way to OpenBook?
Serum's FTX-controlled upgrade authority raised security concerns after FTX and Alameda Research collapsed in November 2022. Upgrade authority controlled changes to the deployed program's code, creating a dependency beyond individual trade signatures. The original mainnet program became defunct, and integrations moved away from it.
OpenBook began as a separately deployed community fork of Serum V3. The fork used a new program address and multisignature upgrade control. Shared code ancestry did not make the deployments identical trading venues. Market addresses and the program an application targeted distinguished their account state and execution. A familiar interface name alone did not identify which deployment it used.
Market access and operational dependencies
Market access depended on deployment-specific authorization rules and infrastructure capable of submitting Solana transactions. The protocol supported ordinary permissionless markets and permissioned variants. A permissioned market added an authority whose signature authorized creation of an OpenOrders account. Proxy programs could enforce access conditions around that authority.
On-chain order records and account ownership exposed trading activity through public blockchain state. Wallet control therefore coexisted with visible market participation and dependence on the program's security. Solana transaction availability could not create opposing orders or restore an application's withdrawn support.
What readers ask about Serum
Was SRM staking required for ordinary trading?
No, ordinary legacy trading did not require staking SRM. The order instructions accepted an optional SRM or MSRM account for qualifying fee discounts. Trading still required the relevant token balance, an authorized signer, and SOL for transaction fees and any necessary account creation.
Why did some prices fail the tick-size check?
Some prices did not match the legacy market's tick size, the permitted increment between order prices. Base and quote lot sizes, together with token decimals, determined those increments. A price between allowed increments could not express the requested order exactly. This precision constraint belonged to the market's configuration.
When could the SOL funding an OpenOrders account be reclaimed?
The legacy program could return an OpenOrders account's SOL funding to a designated destination once its owner authorized closure, every order slot was free, and both base and quote balances were zero; this returned the account's storage deposit without refunding transaction fees.
Did cancelling an order reverse earlier fills?
Cancelling a legacy order removed its remaining resting quantity; it did not undo trades the matching engine had already executed. A cancellation arriving after another matching transaction could therefore affect less quantity than expected. Previously acquired tokens and any released funds remained subject to the applicable settlement path.
Could an Ethereum ERC-20 token trade directly in a Solana market?
Legacy markets traded Solana token balances, so an ERC-20 balance on Ethereum required a compatible Solana representation before participation. Cross-chain transfer and token representation involved separate infrastructure with its own custody and redemption conditions. An Ethereum version of SRM did not make the order book an Ethereum trading venue.
How did connection failures affect the trading interface?
Connection failures could prevent a legacy interface from loading markets or displaying balances accurately. The interface depended on a remote procedure call (RPC) service for blockchain data and transaction submission. A fetch error did not establish whether an earlier trade had executed; recorded transaction status and market accounts resolved that separate question.
Did creating a market certify a token's backing?
A legacy market identified the token mints and vaults involved in trading; those records did not establish a token's off-chain backing or redemption rights. A wrapped asset's reserves and an issuer's ability to redeem it were separate questions from the order book's ability to transfer its on-chain token.