GithubHelp home page GithubHelp logo

liskarchive / lisk-dex-core Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 5.96 MB

:gem: Lisk DEX blockchain application

Home Page: https://lisk.com

License: Apache License 2.0

JavaScript 0.36% Batchfile 0.01% TypeScript 98.93% Groovy 0.19% Dockerfile 0.14% Makefile 0.38%

lisk-dex-core's Introduction

Lisk DEX: Core

Lisk DEX: Core

License: Apache 2.0 GitHub tag (latest by date) GitHub repo size DeepScan grade GitHub issues GitHub closed issues

Lisk DEX: Core is a UniSwap v3 inspired decentralized exchange blockchain application developed using the Lisk SDK.

Project Index

Below is an index of the repositories which relate to this repository for easy navigation:

Repository Description
Lisk DEX: Specs The Lisk DEX blockchain specifications.
X Lisk DEX: Core The Lisk DEX blockchain application.
Lisk DEX: Service The Lisk DEX blockchain middleware between Core and UI.
Lisk DEX: UI The Lisk DEX blockchain user-interface.

Modules

The Lisk DEX: Core blockchain application is composed of the following modules:

Module Description
DEX Provides the main liquidity provision and swap functionality of the DEX blockchain.
DEX Governance Provides the proposals submission and proposal voting functionality of the DEX blockchain.
DEX Incentives Provides the minting and distribution of incentives for the native token of the DEX blockchain.
DEX Rewards Defines the block reward scheme for the native token of the DEX blockchain.

For the blockchain specifications relating to these modules, refer to Lisk DEX: Specs.

Installation

Dependencies

The following dependencies need to be installed in order to run this application:

Dependency Version
NodeJS 18.16
Python (for development) 2.7.18

For information on installing these dependencies, refer to Pre-installation Setup Guide.

From Source

To install the application from source, execute the following commands:

git clone https://github.com/LiskHQ/lisk-dex-core.git
cd lisk-dex-core
git checkout development
npm i -g yarn
yarn install --frozen-lockfile
yarn run build
./bin/run --help

With Docker

For information on setting up Docker, refer to Docker Setup Guide.

To build the docker image, execute the following command:

make build-image

Tests

To run the tests without stress tests, execute the following command:

CI=true yarn test

To run the tests with stress tests, execute the following command:

yarn test

Management

From Source

To start the application process, execute the following command:

./bin/run start -n devnet --api-ws --api-ipc

Once the application process is started, Lisk DEX: Core is exposed accordingly:

0.0.0.0:7667 # WebSocket P2P port
0.0.0.0:7887 # WebSocket RPC port

To stop the application process, press the key combination:

CTRL+C

With Docker

To start the application container, execute the following command:

make start ARGS="-n devnet --api-ws --api-ipc"

Once the application container is started, Lisk DEX: Core is exposed accordingly:

0.0.0.0:7667->7667 # WebSocket P2P port
0.0.0.0:7887->7887 # WebSocket RPC port

To stop the application container, execute the following command:

make stop

Contributors

https://github.com/LiskHQ/lisk-dex-core/graphs/contributors

Disclaimer

Warning

The source code of Lisk DEX: Core is considered to be a pre-release beta version that is subject to missing or incomplete features, bugs, and potential security flaws, and is therefore not suitable for usage in a production environment such as the Lisk Mainnet.

By using the source code of Lisk DEX: Core, you acknowledge and agree that you have an adequate understanding of the risks associated with the use of the source code of Lisk DEX: Core and that it is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. To the fullest extent permitted by law, in no event shall the Lisk Foundation or other parties involved in the development of Lisk DEX: Core have any liability whatsoever to any person for any direct or indirect loss, liability, cost, claim, expense or damage of any kind, whether in contract or in tort, including negligence, or otherwise, arising out of or related to the use of all or part of the source code of Lisk DEX: Core.

License

Copyright 2016-2024 Lisk Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

lisk-dex-core's People

Contributors

irfan-personal avatar emiliolisk avatar daniel-lightcurve avatar 10dimensions avatar naureen1lightcurve avatar karmacoma avatar dependabot[bot] avatar nazgolze avatar

Stargazers

Mateusz Nowaczyk avatar

Watchers

 avatar shuse2 avatar Abhishek Jalan avatar  avatar

lisk-dex-core's Issues

Implement Collect Fees functionality

Description

Allow users to collect fees from an existing position (s) without adding or removing liquidity.

Acceptance Criteria

Users should be able to:

  • Collect fees from position(s)
  • Success event is emitted

Implementation is unit tested and integration tested

Implement `swapped` event

Description

This event is emitted if a successful swap is performed.

Acceptance Criteria

  • SwappedEventDataSchema is added in schemas.ts file.
  • Swapped events are defined and added in the events folder.
  • Register event in the module.ts
  • Emission of an event (EVENT_NAME_SWAPPED) in case of a successful swap.
  • All files are updated.

Additional Information

Prepare Lisk DEX: Core 1.1 for RC

Description

TBD

Motivation

  • Conduct an external security audit of the codebase
  • Prepare the application for release onto a permanent testnet

Tasks

TBD

Setup schemas for pool substore

Description

Create pool substore schemas. This is required so pool information can be stored in the newly created sidechain.

Acceptance Criteria

  • Schema must be valid
  • Implementation is unit tested

Setup schemas for position substore

Description

Create position substore schemas. This is required so position information can be stored in the newly created sidechain.

Acceptance Criteria

  • Schema must be valid
  • Implementation is unit tested

Implement DEX module

Description

Implement LIP to introduce a base DEX Module. This will specify the state store and other fundamental aspects of DEX.

Motivation

The basic DEX architecture and blockchain application will consist of the Implementation of DEX Module, Swap interaction and Liquidity Provision.

Tasks

Sprint 08

Sprint 09

Implement big endian encoding and decoding

Description

Create functions for big endian encoding and decoding. This is required for the Q96 number format implementation.

Acceptance Criteria

  • Functions should be able to:
    • Encode big endian
    • Decode big endian
  • Implementation is unit tested

Implement DEX rewards module

Description

To allow the development of the module responsible for minting and distributing rewards for users on the DEX sidechain. The aim of this roadmap objective is to extend the functionality of Lisk DEX Core to distribute those rewards.

Motivation

  • Implement "DEX rewards module"

Tasks

Sprint 12

Prepare Lisk DEX: Core v2.0.0 for rc

Description

TBD

Motivation

  • Conduct an external security audit of the codebase
  • Prepare the application for release onto a permanent testnet

Tasks

TBD

Setup schemas for genesis block processing

Description

Review and make sure all existing schemas (position, protocol settings, price tick, pool) are updated. Then use this information to create the genesis block schema. This is required so the genesis block can be created for the application in the newly created sidechain, as any changes to the schema require rebuilding the genesis block.

Acceptance Criteria

  • Schema must be valid
  • Implementation is unit tested

Implement Q96 number format

Description

Implement Q96 number format to calculate asset pricing with high precision. This is required to ensure reliability and precision on calculations, using square root pricing. This makes use of implementing big endian encoding and decoding.

Acceptance Criteria

  • Functions should be able to:
    • Encode values to Q96
    • Decode Q96 values
    • Handle operations on Q96 values
  • Implementation is unit tested

Initialize genesis state for DEX module

Description

Before launching the application, the genesis block has to meet certain requirements, and this is ensured during deployment. These parameters would get carried on to subsequent blocks, ensuring that expectations are met from a protocol standpoint. This is implemented after setting up schemas for genesis block processing.

Acceptance Criteria

  • Genesis is successfully initialized
  • Implementation is unit and integration tested

Prepare Lisk DEX: Core v1.0.0 for rc

Description

TBD

Motivation

  • Conduct an external security audit of the codebase
  • Prepare the application for release onto a permanent testnet

Tasks

TBD

Implement liquidity provision

Description

The Lisk DEX is a blockchain application built with the Lisk SDK v6.0.0 to provide its users an opportunity to access Lisk ecosystem tokens without interacting with any centralized exchange. The Lisk DEX application v1.0.0 offers two main features for its users, i.e., token swapping and automated market maker or liquidity provision. The aim of this roadmap objective is to extend the functionality of Lisk DEX Core to manage liquidity provision for it's users.

Motivation

  • Implement "Define liquidity provider interactions for DEX module" LIP

Tasks

Sprint 10

Sprint 11

Sprint 13

nil

Sprint 14

Sprint 15

Implement Create Position functionality

Description

Allow users to create a new position for a pool, a pair of tokens and a given fee tier. This is required so users are able to provide liquidity.

Acceptance Criteria

Users should be able to:

  • Create a position on a specific pool
  • Add liquidity to the position
  • Success event is emitted
  • Implementation is integration tested.

Prepare Lisk DEX: Core v1.0.0 for alpha.0

Description

The purpose of this epic is to prepare the Lisk DEX v.1.0.0 for beta release after fixing the bugs identified by the initial quality assurance.

Motivation

Prepare the application for release onto a temporary alphanet

Tasks

Sprint 24

Sprint 24

Sprint 25

Implement prices and sqrt prices

Description

Since most of the operations for the DEX module require math operations involving the square root price, we store the square root price in most cases instead of the price. We need to be able to get the square root and the square of an arbitrary number.

Acceptance Criteria

  • Functions should be able to:
    • Get the square root of an arbitrary number
    • Get the square of an arbitrary number
  • Implementation is unit tested

Initialize fee tiers

Description

Initialize fee tiers with the following values:
{100, 2}
{500, 10}
{3000, 60}
{10000, 200

Acceptance Criteria

  • Fee tiers should be initialized
  • Implementation is unit tested

Setup schemas for protocol settings substore

Description

Create protocol settings substore schemas. This is required so protocol settings information can be stored in the newly created sidechain.

Acceptance Criteria

  • Schema must be valid
  • Implementation is unit tested

Prepare Lisk DEX: Core 1.1 for Beta

Description

TBD

Motivation

  • Prepare the application for release onto a temporary betanet
  • Prepare the application for security auditing

Tasks

TBD

SDK v6 Migration

Description

Migrate current development branch to SDK v6 to stay updated. This is required before any further changes are made, so the upgrade can be merged to the pending branches.

Acceptance criteria

  • Lisk DEX Core runs without errors
  • Lisk DEX Core passes unit tests

Add Jenkinsfile

This first iteration (PR incoming in a few minutes) is mostly analogous to what's in the Lisk Core Jenkinsfile right now ๐Ÿ‘

Implement `getAllPoolIDs` functionality

Description

Implement the getAllPoolIDs functionality to return an array of all pool IDs. The input parameter is the ID of the poolStore.

Acceptance Criteria

  • An array of all pool IDs is returned
  • Functionality is implemented as per specification.
  • Implementation is unit tested
  • Unit tests are up-to-date

Implement core application using Lisk SDK v6.0.0

Description

Migrate current development branch to SDK v6 to stay updated. This is required before any further changes are made, so the upgrade can be merged to the pending branches.

Motivation

  • Bootstrap the core application using Lisk SDK 6.0 (for Lisk Interoperability)
  • Integrate the DEX module

Tasks

Implement Remove Liquidity functionality

Description

Allow users to remove liquidity from an existing position.

Acceptance Criteria

Users should be able to:

  • Remove liquidity from a position
  • Collect fees from a position
  • Success event is emitted

Implementation is unit tested and integration tested.

Implement DEX sidechain configuration

Description

It is the implementation of DEX sidechain configuration LIP . This objective will handle the configuration of the Lisk DEX v1.0.0 blockchain, including the selection of modules, the choice of configurable constants and the genesis block.

Motivation

The motivation for this objectives is to implement the modules, configurable constants and genesis block of the Lisk DEX v1.0.0. blockchain and to have one document linking to all relevant specifications for the Lisk DEX v1.0.0. blockchain.

Task

Sprint 22

Sprint 23

Sprint 24

  • Nil

Sprint 25

  • Nil

Sprint 26

Implement internal auxiliary functions

Description

Implement the required internal auxiliary functions for liquidity provision. These functions are required because they are being used by the rest of the commands.

Acceptance Criteria

  • Existing tests are passing

Implement Create Pool functionality

Description

Allow users to create a new pool for a pair of tokens and a given fee tier. This is required so users are able to provide liquidity.

Acceptance Criteria

Users should be able to:

  • Create a new pool with a specific fee tier
  • Create an initial position on the created pool to provide liquidity
  • Add liquidity in the created pool
  • Success event is emitted
  • Implementation is integration tested.

Implement Add Liquidity functionality

Description

Allow users to add liquidity to an existing position. This is required for liquidity pools to have enough liquidity to perform swaps.

Acceptance Criteria

Users should be able to:

  • Add liquidity to a position
  • Collect fees from a position
  • Success event is emitted
  • Implementation is integration tested.

Implement internal auxiliary functions

Description

Implement the required internal auxiliary functions for Implement DEX Module. These functions are required because they are used by the rest of the commands.

Acceptance Criteria

  • Implementation is unit tested

Implement swap interaction for DEX module

Description

The aim of this roadmap objective is to extend the functionality of Lisk DEX Core v1.0.0 to manage the process of token swapping. The DEX users are being offered with three types of swaps:

  • Swap with exact input
  • Swap with exact output
  • Swap with price limit.

Motivation

The Lisk DEX application v1.0.0 offers two main features for its users, i.e., token swapping and automated market maker or liquidity provision. To serve these features, swap functionality has been developed as per the specifications outlined in the LIP.

Additional Information

  • The Lisk DEX swap interaction also uses the function implemented as a part of Implement concluded token economics within DEX module and Implement offchain endpoints for DEX module so it's best for developers to understand these functions before implementing/ testing/ understanding the swap module.
  • LIP for swap interaction.

Tasks

Sprint 18

Sprint 19

Sprint 20

Sprint 21

Setup schemas for price tick substore

Description

Create price tick substore schemas. This is required so price tick information can be stored in the newly created sidechain.

Acceptance Criteria

  • Schema must be valid
  • Implementation is unit tested

Create stored notations and constants

Description

Ensure all needed notations and constants are defined and able to be used throughout the project.

Acceptance Criteria

  • Stored notations are created
  • Constants are created
  • Implementation is unit tested

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.