Giter Site home page Giter Site logo

sachinsmc / bonds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ixoworld/bonds

1.0 1.0 0.0 35.7 MB

A custom Cosmos SDK module for universal token bonding curve functions.

License: Apache License 2.0

Makefile 0.13% Go 16.01% Shell 1.81% Python 0.01% HTML 0.13% JavaScript 81.90%

bonds's Introduction

Bonds Module

The Bonds module is a custom Cosmos SDK module that provides universal token bonding curve functions to mint, burn or swap any token in a Cosmos blockchain.

In the future, once the Cosmos Inter-Blockchain Communication (IBC) protocol is available, this should enable cross-network exchanges of tokens at algorithmically-determined prices.

The Bonds module can be deployed through Cosmos Hubs and Zones to deliver applications such as:

  • Automated market-makers (see Uniswap)
  • Decentralised exchanges (see Bancor)
  • Curation markets (see Relevant)
  • Development Impact Bonds (see ixo alpha-Bonds)
  • Continuous organisations (see Moloch DAO)

Hayek famously said that "...prices are an instrument of communication and guidance which embody more information than we directly have".

Module functions

Any Cosmos application chain that implements the Bonds module is able to perform functions such as:

  • Issue a new token with custom parameters.
  • Pool liquidity for reserves.
  • Provide continuous funding.
  • Automatically mint and burn tokens at deterministic prices.
  • Swap tokens atomically within the same network.
  • Exchange tokens across networks, with the IBC protocol.
  • Batch token transactions to prevent front-running
  • Launch a decentralised autonomous initial coin offerings (DAICO)
  • ...and other DeFiant innovations.

Pricing algorithm libraries

The Bonds module framework supports libraries for all types of pricing algorithms, such as:

  • Exponential
  • Logarithmic
  • Negative exponential
  • Constant product
  • Positive initial price
  • Quasi-polynomial
  • Reserved Supply (Augmented)

Each formula is specified within the module library. This includes:

  • Derived Mint equation
  • Derived Burn equation

Updates to the module pricing functions must pass through a network governance process to update the module on all nodes, for changes to be made. This is an important security feature.

Parameters

Each bond has an initial set of constant state (invariant) parameters that cannot be updated once these have been initialised. Parameters include:

  • Pricing function (the algorithm that will be used)
  • Issuer
  • Token name
  • Token symbol
  • Reserve wallet address
  • Transaction fee rate
  • Exit tax rate
  • Fee wallet address
  • Maximum token supply
  • Order quantity limits
  • Sanity rates

When a bond transaction (such as buy, sell, swap) is submitted, this includes the variable parameters:

  • Order quantity
  • Maximum price
  • Wallet address

Some of the parameters of the bond may be edited:

  • Token name
  • Sanity rates
  • Order quantity limits

Building and Running

Note: Requires Go 1.13+

This repository is set up as a Cosmos SDK application and contains the Bonds module under ./x/bonds/.

To build and run the application:

make run

Alternatively, to run with one of the users set up to use Ledger:

make run_ledger

To build and run the application with some preset accounts:

make run_with_data

Demos

To run a demo (requires application to be run using run_with_data):

make demo

The demo consists of:

  • Bond creation
  • Bond querying
  • A mix of buys and sells

To run a more specific demo, check out the scripts/more_demos/ folder.

Tutorials

Guided tutorials are also provided and can be found in the tutorials folder here!

bonds's People

Contributors

migueldingli1997 avatar angelorc avatar ig-shaun avatar hxrts avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.