Onchain vs. Offchain Order Books

The CC Forums

Staff member
Hello and welcome to TCF. We prefer that postings to external links or articles include at least an excerpt from the linked article or blog. I understand the link included is intended both as an informational post as well as to raise awareness of the referenced exchange. We allow that as long as there is also informational value to the posts placed here.

One mutually beneficial way to share articles would be to post the content here and then share links on social media inviting Q&A in the thread here. By doing this, you can ensure that all links contained in the article function as desired.

Thanks for your participation. Feel free to give us feedback or ask questions in the Site Feedback section.

Advantages of the Ethex on-chain order book

EtherDelta has been a big inspiration for DApps and decentralized trading. Just a few days ago, EtherDelta crossed 10 million transactions on their smart contract. This is a great demonstration of the Ethereum network. Trading on this contract makes up almost 4% of the transactions on Ethereum mainnet. It’s one of the most active contracts in the Ethereum network.


Congratulations EtherDelta!
EtherDelta has shown that distributed trading is a killer app for blockchains. Not only do blockchains allow us to verifiably send funds, but now you can swap funds in a trustless way. It’s practical and popular use case.

Like many other projects, Ethex has been inspired by this new and proven application of blockchains. The source to EtherDelta’s contract and activity can be seen here.

When creating Ethex, our goal was to improve upon distributed trading. We made the decision to publish our order book on the blockchain. This means that when someone makes an offer to buy or sell, that offer must be announced on the blockchain for all to see.


Buyers and sellers using Ethex
EtherDelta and other decentralized systems use a deposit, off chain offer, withdraw workflow to enable trading. Ethex uses a direct make order, take order workflow. This gives us the following advantages.

On-chain order books do not require relayer or server
If you download the Ethex software you can use it to trade, provided you can access any Ethereum node, including your own! We provide an optimized Ethereum node, however it isn’t required for you to use Ethex. Off-chain systems require relayer servers which and take some effort to run and represent a point of failure in the system.


Direct, wallet to wallet trading. No servers required.
On-chain order books are more difficult to manipulate
When offers are off-chain, traders can deposit funds and make it look like tokens are traded at any price they like. Because Ethex uses on-chain offers, orders are always published to every Etherem node. You can’t make exclusive or private deals.

On-chain order books are fast, efficent and easy to use.
Because you do not need to deposit your funds before you can trade, you can buy tokens with a single transaction directly to your wallet. This means less waiting and paying for the blockchain gas. To buy a token on an off-chain trading system, you have to pay and wait three times. To buy a token on-chain, it’s a single transaction. It’s a myth that on-chain order books are expensive. You just have to have the right protocol. Selling tokens is as efficient as you can get. Provided you have allowed them, selling tokens at Ethex is also one transaction.

To emphasize this point, consider this recent trade on Ethex. Someone bought $484 worth ZRX and spent 4 gwei or 11 cents on a single transaction. Other decentralized exchanges make you do 3 transactions, thats more waiting and more gas. Gas prices on most trades are going to be less then exchange fees. A typical 0.3% fee on a $484 trade is $1.45. The gas on a transaction on the Ethex contract is going to be much lower then that.

On-chain order books have less frivolous offers and cannot spoof offers
Because making an offer requires paying gas traders won’t make tons of pointless offers. With off-chain systems, these offers can jam up trading software and cause issues. Likewise you cannot make offers without committing funds.

On-chain order books can prevent front running.
Front running occurs when someone on the trading platform knows you are going to trade before anyone else, and takes advantage of it. By publishing to the blockchain, every trader has an equal opportunity to take an offer. Only miners through major effort could front run, or gain an advantage in a trade.

Off-chain order books allow you to change price without a new transaction.
Because orders are not stored on-chain, with an expiration block, you can effectively change the price of an offer without committing a new transaction.

Decentralized trading has massive improvements to centralized trading. For the first time in history, two traders can swap assets algorithmically and confidently. Protocols like 0x and EtherDelta are great implementations of this idea and are welcome solutions to many of the centralized trading problems. However, Ethex has a fully on-chain approach that has some real advantages that put the blockchain to use.


I think CryptoTC pirated your article. Nice! Lol.

Seriously though the piece is very good and your other Medium articles are very good as well. Please share more. Very helpful. Thanks.

Old Man Crypto

Expert chainblocker
There has been a lot of debate on whether onchain or offchain order books are better for exchanges. I think onchain is awesome. The cofounder of Ethex wrote this article about the benefits which I think sums it up nicely.
What do you all think?

Apology for a stupid question but I don’t trade anything stocks, crypto, or other. Are exchanges like Coinbase, Bittrex, Poloniex on-chain or off-chain books? Or do those terms not apply to trading where you can see all the orders?


Crypto Fat Cat
I think CryptoTC pirated your article. Nice! Lol.

Seriously though the piece is very good and your other Medium articles are very good as well. Please share more. Very helpful. Thanks.

That wasn’t me. Site head honcho.

@Old Man Crypto exchanges aren’t on or off-chain. They trade orders on their own books. All orders can be seen, but they settle trades as an account balance assigned to you from their held coins. The OP is talking about decentralized trading.