GithubHelp home page GithubHelp logo

honestlybc / liquidity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tendermint/liquidity

0.0 0.0 0.0 58.43 MB

Cosmos SDK Liquidity module

License: Apache License 2.0

Makefile 1.17% Go 97.85% Shell 0.98%

liquidity's Introduction

codecov PkgGoDev

Liquidity Module

the Liquidity module of the Cosmos-SDK, which serves AMM(Automated Market Makers) style decentralized liquidity providing and coin swap functions.

The module enable anyone to create a liquidity pool, deposit or withdraw coins from the liquidity pool, and request coin swap to the liquidity pool.

This module will be used in the Cosmos Hub, and any other blockchain based on Cosmos-SDK.

  • The Cosmos Hub AMM should have strong philosophy of inclusiveness of users from different blockchains because its prime utility is inter-blockchain communication
  • To possess such characteristics, the Liquidity module should provide most convenient ways for external users to come in and use the services provided by the Cosmos Hub
  • The Liquidity module should not anticipate specific assets, such as Atom, into the process of user-flow in a forced manner. It is repeatedly proved that unnatural anticipation of native coin at unavoidable parts of process resulting in poor user attraction

Key features

new-amm-model

Combination of Traditional Orderbook-based Model and New AMM Model

  • Although new AMM model has multiple advantages over orderbook-based model, combination of both models will create more enriched utilities for wider potential users
  • We re-define the concept of a “swap order” in AMM as a “limit order with short lifetime” in an orderbook-based exchange. Then, two concepts from two different models can be combined as one united model so that the function can provide both ways to participate into the trading and liquidity providing activities
  • Although our first version of the Liquidity module will not provide limit order option, but the base structure of the codebase is already anticipating such feature expansion in near future
  • Advantages of combined model
    • More freedom on how to provide liquidity : Limit orders
    • Combination of pool liquidity and limit order liquidity provides users more enriched trading environment

For detailed Mechanism, you can find on our recent Paper

Installation

Requirements

Requirement Notes
Go version Go1.15 or higher
Cosmos-SDK v0.40.0-rc4

Get Liquidity Module source code

$ git clone https://github.com/tendermint/liquidity.git
$ cd liquidity
$ go mod tidy

Build

$ make build 

You can find the liquidityd binary on build/

Install

$ make install 

liquidityd

Tx

$ ./liquidityd tx liquidity --help

Liquidity transaction subcommands

Usage:
  liquidityd tx liquidity [flags]
  liquidityd tx liquidity [command]

Available Commands:
  create-pool Create Liquidity pool with the specified pool-type, deposit coins
  deposit     Deposit submit to the batch of the Liquidity pool with the specified pool-id, deposit coins
  swap        Swap offer to the Liquidity pool with the specified the pool info with offer-coin, order-price
  withdraw    Withdraw submit to the batch from the Liquidity pool with the specified pool-id, pool-coin of the pool

Query

$ liquidityd query liquidity --help

Querying commands for the liquidity module

Usage:
  liquidityd query liquidity [flags]
  liquidityd query liquidity [command]

Available Commands:
  batch       Query details of a liquidity pool batch of the pool
  batches     Query for all liquidity pools batch
  deposits    Query for all deposit messages on the batch of the liquidity pool
  params      Query the current liquidity parameters information
  pool        Query details of a liquidity pool
  pools       Query for all liquidity pools
  swaps       Query for all swap messages on the batch of the liquidity pool
  withdraws   Query for all withdraw messages on the batch of the liquidity pool

A detailed document on client can be found here. client.md

Development

Test

$ make test

Protobuf, Swagger

generate *.proto files from proto/*.proto

$ make proto-gen

generate swagger.yaml from proto/*.proto

$ make proto-swagger-gen

Resources

liquidity's People

Contributors

dongsam avatar hyung-bharvest avatar tac0turtle avatar alessio avatar fadeev avatar paddymc 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.