8000 GitHub - tarunbatra/dex: Decentralized Exchange
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tarunbatra/dex

Repository files navigation

Decentralized Exchange (DEX)

The decentralized exchange is created using Grenache. It has two distinct layers:

Setup

Setting up the DHT

npm i -g grenache-grape
# boot two grape servers

grape --dp 20001 --aph 30001 --bn '127.0.0.1:20002'
grape --dp 20002 --aph 40001 --bn '127.0.0.1:20001'

Install dependencies

npm i

Running

Run first client

npm run client1

Run second client

npm run client2

TODOs

Initialization

  • The clients should, on the first run, request the existing distributed order book. They do not do that now.

Race condition

  • The clients use the Bittorrent DHT hashing algorithm to relize a distributed locking which is not ideal.
  • The clients do not handle race condition well due to missing mutex unlocking. See more here.

Price of trades

  • The order matching code does not consider price. So the exchange does not support LIMIT orders.

About

Decentralized Exchange

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0