Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Blockchain Development for Finance Projects

You're reading from   Blockchain Development for Finance Projects Building next-generation financial applications using Ethereum, Hyperledger Fabric, and Stellar

Arrow left icon
Product type Paperback
Published in Jan 2020
Publisher Packt
ISBN-13 9781838829094
Length 530 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ishan Roy Ishan Roy
Author Profile Icon Ishan Roy
Ishan Roy
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Blockchain Payments and Remittances
2. Blockchain in Financial Services FREE CHAPTER 3. Building a Blockchain Wallet for Fungible and Non-Fungible Assets 4. Designing a Payment Gateway for Online Merchants 5. Corporate Remittances and Settlement 6. Enabling Cross-Border Remittances with Real-Time KYC/AML Verification 7. Section 2: Blockchain Workflows Using Smart Contracts
8. Building a Letter of Credit Workflow Module Using Smart Contracts 9. Section 3: Securing Digital Documents and Files Using Blockchain
10. Building a Tamper-Proof Document Storage System 11. Section 4: Decentralized Trading Exchanges Using Blockchain
12. Building a Decentralized Trading Exchange 13. Developing a Currency Trading Exchange for Market Making 14. Looking into the Future 15. Other Books You May Enjoy Appendix: Application Checklist

Orderbook smart contract

The orderbook smart contract is the core component of our entire project.

It carries out the following functions:

  • Records incoming buy/sell offer requests from the frontend and moves the base or counter asset from the user's Ethereum account to the smart contract account.
  • Allows traders to view the recorded buy/sell offers on the smart contract.
  • Accepts trade requests against already recorded buy/sell offers and executes the trade. As part of the trade, the orderbook updates the available amount in an offer, and transfers the base or counter asset both from the trader's account and to the trader's account.
  • Emits an event to indicate when a new buy or sell offer is updated, or a new trade is carried out. This event will be subscribed to by our frontend app to update and display the orderbook in real time.

Now, let's write our orderbook...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime