nibiru

module
v0.21.0-rc.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2023 License: Apache-2.0

README

Nibiru Chain

Go Reference Nibiru Test workflow Nibiru Test workflow GitHub Discord Badge

Nibiru Chain is a proof-of-stake blockchain that unifies leveraged derivatives trading, spot trading, staking, and bonded liquidity provision into a seamless user experience, enabling users of over 40 blockchains to trade with leverage using a suite of composable decentralized applications.

Components of Nibiru

  • CosmWasm Smart Contracts: Rust-based, WebAssembly (WASM) smart contracts built for the Cosmos Ecosystem.
  • Nibi-Perps: A perpetual futures exchange where users can take leveraged exposure and trade on a plethora of assets — completely on-chain, completely non-custodially, and with minimal gas fees.
  • Oracle Module: Nibiru accurately prices assets using a native, system of decentralized oracles, and communicates with other Cosmos layer-1 chains using the Inter-Blockchain Communication (IBC) (opens new window)protocol.
  • Nibi-Swap: An automated market maker protocol for multichain assets. This application gives users access to swaps, pools, and bonded liquidity gauges.
  • NUSD Stablecoin: Nibiru powers a two-token economic model, where NIBI is the staking and utility token for the protocol and NUSD is a capital-efficient, partially collateralized stablecoin for the protocol.

Modules

Module Description
common Holds helper and utility functions to be utilized by other x/ modules.
epochs Often in the SDK, we would like to run certain code every-so often. The purpose of epochs module is to allow other modules to set that they would like to be signaled once every period. So another module can specify it wants to execute code once a week, starting at UTC-time = x. epochs creates a generalized epoch interface to other modules so that they can easily be signalled upon such events.
oracle Handles the posting of an up-to-date and accurate feed of exchange rates from the validators.
perp Powers the Nibi-Perps exchange. This module enables traders to open long and short leveraged positions and houses all of the PnL calculation and liquidation logic.
spot Responsible for creating, joining, and exiting liquidity pools. It also allows users to swap between two assets in an existing pool. It's a fully functional AMM.
stablecoin Responsible for handling mint and redeem transactions with NUSD.
wasm Implements the execution environment for WebAssembly (WASM) smart contracts.

Nibiru is built with the Cosmos-SDK on Tendermint Core consensus, accurately prices assets using a system of decentralized oracles, and communicates with other Cosmos layer-1 chains using the Inter-Blockchain Communication (IBC) protocol.

⚙️ — Documentation

Conceptual and technical documentation can be found in the Nibiru docs. Detailed module-specific documentation is included in the top-level README (x/module/README.md).

💬 — Community

If you have questions or concerns, feel free to connect with a developer or community member in the Nibiru discord. We also have active communities on Twitter and Telegram.

Discord Tweet Telegram


⛓️ Installation: Developing on the chain locally

Installation instructions for the nibid binary can be found in INSTALL.md.

Recommended minimum specs:

  • 2CPU, 4GB RAM, 100GB SSD
  • Unix system: MacOS or Ubuntu 18+

Nibid CLI

To simply access the nibid CLI, run:

make install

Usage instructions for the nibid CLI are available at docs.nibiru.fi/dev/cli and the Nibiru Module Reference.

Running a Local Node

On a fresh clone of the repo, simply run:

make localnet

and open another terminal.

Generate the protobufs

make proto-gen

Linter

We use the golangci-lint linter. Install it and run

golangci-lint run

at the root directory. You can also install the VSCode or Goland IDE plugins.

Multiple Nodes

Run the following commands to set up a local network of Docker containers running the chain.

make build-docker-nibidnode

make localnet-start

License

Licensed under the MIT License.

Directories

Path Synopsis
app
cmd
x
common/testutil
Package nullify provides methods to init nil values structs for test assertion.
Package nullify provides methods to init nil values structs for test assertion.
common/testutil/cli
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
epochs/types
Package types is a reverse proxy.
Package types is a reverse proxy.
inflation/types
Package types is a reverse proxy.
Package types is a reverse proxy.
oracle/keeper
nolint
nolint
oracle/types
Package types is a reverse proxy.
Package types is a reverse proxy.
perp/v2/types
Package types is a reverse proxy.
Package types is a reverse proxy.
spot/types
Package types is a reverse proxy.
Package types is a reverse proxy.
stablecoin/keeper
Package keeper that mints Nibiru stablecoins, maintains their price stability, and ensures that the protocol remains collateralized enough for stablecoins to be redeemed.
Package keeper that mints Nibiru stablecoins, maintains their price stability, and ensures that the protocol remains collateralized enough for stablecoins to be redeemed.
stablecoin/types
Package types is a reverse proxy.
Package types is a reverse proxy.
sudo/pb
Package pb is a reverse proxy.
Package pb is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL