Skip to content

A decentralized, non-custodial platform for instant Nexa assets exchange across supporting blockchains.

License

Notifications You must be signed in to change notification settings

flipstarter-causes-cash/nexa-exchange

This branch is 104 commits behind avasdao/nexa-exchange:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Ava's DAO
Jan 4, 2024
e07dbc4 · Jan 4, 2024
Nov 5, 2022
Nov 6, 2022
Dec 27, 2023
Dec 18, 2023
Aug 7, 2023
Dec 20, 2023
Sep 21, 2023
Jan 1, 2024
Jan 1, 2024
Nov 8, 2022
Jan 4, 2024
Aug 16, 2022
Nov 6, 2022
Nov 6, 2022
Nov 5, 2022

Repository files navigation

Nexa Exchange banner

Guide | API Docs | Consulting | Community

Built with ♥︎ by Ava's DAO

Nexa Exchange

Build Status Telegram Chat

Nexa Exchange is a high performance exchange trading server. The core matching engine is a fully async, single threaded, memory based matching engine with thousands of TPS.

Features

  • order matching
  • order state change notification
  • user balance management
  • market data

Non Features

  • user account system
  • cryptocurrency deposit/withdraw

Technical Details

Language: Node.js API Interface: JSON-RPC Server framework: Express Storage: NOSQL Databases Persistence: (a)Append operation log and (b)Redis-like fork-and-save persistence

The architecture is heavily inspired by Redis and Viabtc Exchange

Prerequisite

  • cmake
  • librdkafka

Ubuntu / Debian

# apt install cmake librdkafka-dev

RedHat / CentOS / Fedora

# dnf install cmake librdkafka-devel

MacOS

$ brew install cmake librdkafka

Todos

  • push notifications using websockets
  • API documentation
  • Better test coverage

Example

# Simple test
$ cd $DingirExchangeDir

# Lanuch the external dependency services like Postgresql and Kafka
$ docker-compose --file "./orchestra/docker/docker-compose.yaml" up --detach
$ make startall # or `cargo run --bin matchengine` to start only core service
$ cd $DingirExchangeDir/examples/js ; npm i

# This script will put orders into the exchange.
# Then you will find some orders got matched, trades generated,
# and users' balances updated accordingly.
$ npx ts-node tests/trade.ts

Release

We uses cross to generate release builds for Linux Distributions. For example, you could generate a static release build via the below command.

RUSTFLAGS="-C link-arg=-static -C target-feature=+crt-static" cross build --bin matchengine --target x86_64-unknown-linux-gnu --release

And a new Docker image could be generated by the release script.

# In root directory of this project
./release/release.sh YOUR_DOCKER_REGISTRY_DOMAIN.COM:YOUR_DOMAIN_PORT NEW_IMAGE_TAG

Related Projects

Peatio: A full-featured crypto exchange backend, with user account system and crypto deposit/withdraw. Written in Ruby/Rails. It can process less than 200 orders per second.

viabtc exchange server: A high performance trading server written in C/libev. Most components of the project are written from scratch including network, RPC. It can process thousands of orders per second.

About

A decentralized, non-custodial platform for instant Nexa assets exchange across supporting blockchains.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 77.0%
  • JavaScript 8.4%
  • TypeScript 8.2%
  • SCSS 3.2%
  • Shell 1.4%
  • Ruby 0.9%
  • Other 0.9%