Git Product home page Git Product logo

alephium-dex's Introduction

Alephium DEX

Install Alephium Extension Wallet

Download the Extension wallet: Google Chrome Store or Firefox Store

Clone the DEX repo

git clone https://github.com/alephium/alephium-dex.git
cd alephium-dex
npm install

Testnet

Build and run the DEX for Testnet:

npm run build && npm run start

Now you can open the http://localhost:3000/alephium-dex, you will see something like this:

Devnet

Setup local development network

Start a local development network following the instructions here.

Compile the contracts

npm run compile

Deploy dex contracts to devnet

npm run deploy

Create test tokens on devnet

npx ts-node scripts/devnet.ts create-tokens -n 5

It will create 5 test tokens on devnet, you can also create your own token contracts following this guide.

The output contains all created token contract ids, which will be used when creating token pool in UI.

UI

Build and run the UI:

Devnet

npm run build:devnet && npm run start:devnet

Testnet

npm run build && npm run start

Now you can open the http://localhost:3000/alephium-dex, you will see something like this:

And now you can test the DEX by creating token pool, adding liquidity to the token pool, swapping tokens, and removing liquidity from the token pool.

Deploy dex contracts to mainnet

NODE_URL=https://wallet-v20.mainnet.alephium.org PRIVATE_KEYS=YOUR_PRIVATE_KEY npm run deploy:mainnet

Build and run the UI:

npm run build:mainnet && npm run start:mainnet

alephium-dex's People

Contributors

h0ngcha0 avatar lbqds avatar nop33 avatar polarker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alephium-dex's Issues

Add built-in routing support

Due to input&output model, swap routing cannot be done in a single transaction with the current implementation.

However, it's possible to add this routing feature by implementing the protocol slightly differently. E.g. to swap via A -> B -> C:

  1. the DEX computes the amount change MB for B in (A, B) swap, the amount change MC for C in (B, C) swap.
  2. the DEX sends MA to (A, B) pool, moves MB from (A, B) pool to (B, C) pool, sends MC from (B, C) pool to the caller.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.