Decentralized Exchange Platform | Backend Developer

Christopher Glantschnig

Backend Engineer
Blockchain Developer
Solidity Engineer
Node.js
Vue.js
Web3.js

This project is about a DEX (Decentralized Exchange) based on the Polygon Blockchain. The goal was to create an MVP where you should be able to create Spot Trades, Market Trades as well as Leveraged Trades in real time.

My main responsibility was to take care of the backend. Below you can fine an image of the architecture, which is quite simple, but yet effective. The application has to handle the communication to the frontend (via a REST API), to the Database (Postgres in this case) and to the blockchain smart contract.

simplified architecture

The tech stack in this project included VueJs in the frontend, NodeJs in the backend and Polygon smart contracts are written with solidity. As the database Postgres was used.

This project had 2 key challenges for me.

  1. create a trade matching algorithm which tolerances no failure
  2. communicate with a smart contract, but still have a rich user experience without long waiting times

Trading algorithm

The matching is a slightly adopted version of the Hong Kong Exchange matching. Base values of tokens like BTC, ETH and others are taken from a trusted asset value database on a regular bases. Initially the matching is supposed to run every 15 seconds. So within this time frame the code has to verify the list of buying and selling orders on the decentralized blockchain as well as informing the blockchain about the result.

As this code is very critical to the project it has a 100% coverage and also uses realistic data that will be verified.

a short demonstration of a matching process

Communication to the smart contract

This project taught me how to deal with smart contract using web3.js. Especially the way you have to deal with numbers (bigint) and addresses.

I was taking care of the communication on the backend as well as on the frontend.

Partner With Christopher
View Services

More Projects by Christopher