A custom Cosmos SDK module for universal token bonding curve functions.
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:
Hayek famously said that "...prices are an instrument of communication and guidance which embody more information than we directly have".
Any Cosmos application chain that implements the Bonds module is able to perform functions such as:
The Bonds module framework supports libraries for all types of pricing algorithms, such as:
Each formula is specified within the module library. This includes:
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.
Each bond has an initial set of constant state (invariant) parameters that cannot be updated once these have been initialised. Parameters include:
When a bond transaction (such as buy, sell, swap) is submitted, this includes the variable parameters:
Some of the parameters of the bond may be edited:
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
To run a demo (requires application to be run using run_with_data
):
make demo
The demo consists of:
To run a more specific demo, check out the scripts/more_demos/
folder.
Guided tutorials are also provided and can be found in the tutorials folder here!