GithubHelp home page GithubHelp logo

blockchainmasters21 / simple-dex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpascoli/simple-dex

0.0 0.0 0.0 19 KB

A simple decentralised exchange in Solidity to trade ERC20 tokens.

JavaScript 77.77% Solidity 22.23%

simple-dex's Introduction

simple-dex

A simple Decentralised Exchange to trade ERC20 tokens for ETH.

My main motivation of this little project was to learn solidity, truffle and how to test smart contracts.

The DEX includes the following functionality:

  • Add ERC20 tokens to the dex allow them to the traded.
  • Deposit and widthraw ETH and ERC20 tokens to the dex.
  • Submit limit orders.
  • Submit market orders.
  • Execute trades when a market order is matched against existing limit orders.
  • Supports partially filled limit and orders
  • An order history that stores market and limit orders

The dex keeps a balance of available ETH and tokens that can be used to submit limtit orders. When a user submits a limit ordeer, the amount of ETH or ERC20 tokens required to execute the trade is moved into a separate reserved balance. Cancelling a limit order allows to recover the reserved ETH or ERC20 tokens into the regular account balance so they can be withdrawn.

There are a number of improvements that would be nice to make, for example:

  • Automatically match new limit orders agaisnt existing limit orders in the orderbook.
  • Cancel and update existing limit orders

simple-dex's People

Contributors

cpascoli 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.