Giter VIP home page Giter VIP logo

0xchange's Introduction

Veridex

Chat with us on Discord CircleCI dependencies Status devDependencies Status Coverage Status

This project is forked from 0x-launch-kit-frontend and it have a goal to be the most complete open-source 0x based dex out there. The code here will try to be on sync with the 0x frontend, but with the additional features proposed on the TODO, tests will be include following 0x style.

This source code is used on the VeriSafe Dex as a service.

This repo ships with both an ERC-20 token trading interface and an ERC-721 marketplace interface. However, for now, only improvements on ERC-20 token trading will be done.

To use this fork the following actions are required:

  • Add VSF, 0xbitcoin and 0x as pairs
  • Lets us know you are using this fork
  • Add a Powered by 0x and VeriSafe
  • Don't use another pool associated with this code besides the one on: Veridex Pool. If you are market maker you can join Veridex market pool at Join as Maker

With your help, we can be self-sustainable and complete the long list of TODO's. If you want a feature that is not present on the TODO list, please open an issue requesting a feature request.

Deployed DEX's

List of deployed dex's using this source code:

If you are using the source code of this fork, please let me know! Help the project adding VSF as a pair on your fork!

If you have the URL of an existing relayer, you can use this frontend against it. After installing the dependencies, start the application with this command, replacing RELAYER_URL and RELAYER_WS_URL with the proper value:

REACT_APP_RELAYER_URL='https://RELAYER_URL/' REACT_APP_RELAYER_WS_URL='wss://RELAYER_URL/' yarn start

Usage

Clone this repository and install its dependencies:

You can optionally pass in any relayer endpoint that complies with the 0x Standard Relayer API. For example, if you want to show liquidity from 0x API:

REACT_APP_RELAYER_URL='https://api.0x.org/sra' REACT_APP_RELAYER_WS_URL='wss://api.0x.org/sra' REACT_APP_NETWORK_ID=1 REACT_APP_CHAIN_ID=1 yarn start

Creating a relayer for development

If you don't have a relayer, you can start one locally for development. First create a docker-compose.yml file like this:

version: '3'
services:
    ganache:
        image: 0xorg/ganache-cli
        ports:
            - '8545:8545'
    backend:
        image: 0xorg/launch-kit-backend:latest
        environment:
            HTTP_PORT: '3000'
            NETWORK_ID: '50'
            CHAIN_ID: '1337'
            WHITELIST_ALL_TOKENS: 'true'
            FEE_RECIPIENT: '0x0000000000000000000000000000000000000001'
            MAKER_FEE_UNIT_AMOUNT: '0'
            TAKER_FEE_UNIT_AMOUNT: '0'
            MESH_ENDPOINT: 'ws://mesh:60557'
        ports:
            - '3000:3000'
    mesh:
        image: 0xorg/mesh:7.2.1-beta-0xv3
        environment:
            ETHEREUM_RPC_URL: 'http://ganache:8545'
            ETHEREUM_CHAIN_ID: 1337
            VERBOSITY: 3
            RPC_ADDR: 'mesh:60557'
            # You can decrease the BLOCK_POLLING_INTERVAL for test networks to
            # improve performance. See https://0x-org.gitbook.io/mesh/ for more
            # Documentation about Mesh and its environment variables.
            BLOCK_POLLING_INTERVAL: '5s'
        ports:
            - '60557:60557'
            - '60558:60558'
            - '60559:60559'

and then run docker-compose up. This will create three containers: one has a ganache with the 0x contracts deployed and some test tokens, another one has an instance of the launch kit implementation of a relayer that connects to that ganache and finally a container for 0x-mesh for order sharing and discovery on a p2p network.

After starting those containers, you can run the following in another terminal. A browser tab will open in the http://localhost:3001 address. You'll need to connect MetaMask to localhost:8545.

REACT_APP_RELAYER_URL='http://localhost:3000/v3' REACT_APP_RELAYER_WS_URL='ws://localhost:3000' yarn start
git clone [email protected]:VeriSafe/veridex.git
cd Veridex
yarn

TODO

This is a detailed list of planned features to add to this DEX (includes VeriDex backend) on long term:

  • List Dex Trades
  • Add troll box using ChatBro
  • Fully configuration of orderbook and sell and buy cards
  • Support multiple wallets, like Portis, Torus etc please see list of planned wallets below,
  • Add mobile support
  • Support to transfer tokens
  • Display prices and total holdings on wallet
  • Display median price
  • Add notifications
  • List descriptions for each project
  • List Market Trades
  • List Markets stats
  • List last prices for each token
  • Add Fiat on Ramp
  • Add 0x Instant to easy buy of assets
  • Adding graphs like Trading View
  • Support for mobile dapp browswers like Enjin and Coinbase
  • Mobile friendly
  • Connect to 0x mesh
  • Adding Account market stats
  • Click on buy and sell button to auto-fill
  • Create a costumized front page
  • Order Matching on the Frontend when doing limit orders
  • Page for trading competitions
  • Add instant as standalone
  • Code splitting
  • Report data to the most known crypto data aggregators (In progress)
  • Theme switcher
  • Dex Wizard
  • Upgrade 0x v3
  • i18n
  • Add tour
  • Add crypto price calculator
  • Add Swap interface
  • Add Token factory

Planned Wallets Support

Using VeriDex relayer


REACT_APP_RELAYER_URL='https://dex-backend.verisafe.io/v3' yarn start

VeriDEX OPEN API SPEC

This relayer has additional endpoints to enable market view data with stats and candles. We will be adding as an opt-in option use these features in your frontend. That way you can use a Standard Relayer without any issues.

Environment variables

You can create a .env file to set environment variables and configure the behavior of the dApp. Start by copying the example file (cp .env.example .env) and modify the ones you want. Some things you can configure are:

  • REACT_APP_RELAYER_URL: The URL of the relayer used by the dApp. Defaults to http://localhost:3000/v3
  • REACT_APP_RELAYER_WS_URL: The Websocket URL of the relayer used by the dApp. Defaults to http://localhost:3000/
  • REACT_APP_FEE_PERCENTAGE: The fee percentage amount charged on 0x orders filled via the Forwarder. Note this is limited to */WETH orders for the taker.
  • REACT_APP_FEE_RECIPIENT: The address which receives the fees from the Forwarder.
  • REACT_APP_NETWORK_ID: The network id to build the front end for. E.g 42 for Kovan, 50 for Ganache
  • REACT_APP_CHAIN_ID: The chain id to build the front end for. E.g 42 for Kovan, 1337 for Ganache
  • REACT_APP_DEFAULT_ORDER_EXPIRY_SECONDS: The expiration time for an order. Defaults to 1 day.

Check .env.example for the full list.

Using custom themes

If you want to add your own theme for the app, please read the THEMES.md file

Using custom Config on the DEX

If you want to config the app and markets, please read the CONFIG.md file


0xchange's People

Contributors

agupane avatar unjapones avatar fvictorio avatar gabitoesmiapodo avatar joaocampos89 avatar dekz avatar yellowgh0st avatar mariano-aguero avatar icinsight avatar tomhschmidt avatar fragosti avatar pablofullana avatar adekbadek avatar zabirauf avatar eharris128 avatar

Watchers

 avatar

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.