This chapter deals with building a decentralized trading exchange using a private Ethereum blockchain. Traditionally, trading exchanges require an authority who will facilitate the trade between the buyers and the sellers. This authority will post the buy offers and sell offers from all the traders in a single platform, where they are visible to all the participants. This platform is referred to as the orderbook. Traders can trade against the offers that are posted on the orderbook.
In this chapter, we attempt to decentralize or basically remove the authority that manages the orderbook from the picture. The decentralized exchange will still have an orderbook, except it will be managed by a smart contract and will be available for all the participants to view and trade against in real time. We will be building an exchange on top of this...