2023-05-12 14:34:55 -07:00
2022-02-23 05:51:12 -08:00
2022-02-23 05:51:12 -08:00
2025-05-20 19:38:16 +00:00
2023-05-13 07:03:49 -07:00
2025-06-01 18:34:14 -07:00
2022-02-23 05:51:12 -08:00
2025-05-20 19:38:16 +00:00
2022-02-23 05:51:12 -08:00
2022-02-23 05:51:12 -08:00
2022-02-23 05:51:12 -08:00
2022-02-23 05:51:12 -08:00
2025-06-01 18:42:16 -07:00
2023-10-28 10:11:04 -07:00
2025-04-11 16:15:29 -07:00

bch-dex

js-standard-style semantic-release

bch-dex is a decentralized exchange protocol for permissionless trading of SLP tokens and NFTs. Trading fees are incredibly small, compared to other DEX platforms. The software is based entirely on open protocols and open source software. bch-dex software is maintained by the Permissionless Software Foundation.

This is a prototype web service that monitors one or more Nostr relays for trading signals, to trade BCH and SLP tokens. It's inspired by the SWaP Protocol.

This repository contains the back end code. The user interface is contained in the bch-dex-ui-v3 repository.

Warning: This repository is under active development. Things will be constantly changing and breaking.

Media

Participate

This is an open source project, and we encourage other JavaScript developers to participate in its creation and maintenance. We have two chat rooms for the community:

Installation

Running the DEX requires composition of these different software packages:

  • bch-dex - This repository is the back end software that tracks trade data on the network, generates Offers and Counter Offers, and finalizes trades by accepting Counter Offers.
  • bch-dex-ui-v3 web app and user interface (UI) for bch-dex focused on Sellers of tokens.
  • MongoDB is a database used by bch-dex to store and manage local data, user accounts, etc.

The above software is orchestrated using Docker and Docker Compose. The target operating system is Ubuntu 20+, and the target hardware is amd64 (normal desktop PCs). Trying to operate this software on other operating systems or hardware is possible, but not supported.

Setup instructions:

  1. Follow the direction in this Gist to install Node.js, Docker, and Docker Compose.
  2. Clone the repository with git clone https://github.com/Permissionless-Software-Foundation/bch-dex and enter it with cd bch-dex.
  3. Install dependencies by running npm install
  4. Create a wallet:
  • cd production/scripts
  • node create-wallet.js
  1. Change directory to the production/docker folder.
  2. Pull the Docker images down from Docker Hub: docker-compose pull
  3. Build the core software: docker-compose build --no-cache
  4. Start the Docker containers with docker-compose up -d
  5. Open a web browser and navigate the http://localhost:4500. You'll be able to see new Offers as they come in and are detected by bch-dex.
  6. To take the other side of the trade, click the Take button in the UI.
  7. You can add the 12-word mnemonic from the wallet.json file to the the web wallet, which will mirror your wallet in the UI, and allow you to perform basic wallet functions (send and receive BCH and tokens).

Blockchain Infrastructure

bch-dex requires a Cash Stack back end in order to connect to the blockchain. By default, the Docker containers connect to free-bch.fullstack.cash. Several community-provided servers are provided and can be viewed here. The back end can be changed by setting the CONSUMER_URL environment variable in the docker-compose.yml file.

License

MIT

Languages
JavaScript 97.6%
Dockerfile 1.2%
Shell 0.7%
HTML 0.5%