Chain Development
The specifications for the Osmosis chain itself, for contributing to the protocol or understanding how a module behaves. To set up a local toolchain (build from source, IDE, LocalOsmosis, the osmosisd binary, and key management), see Developer Environment.
Each module page below documents one x/ module: its messages, state, and parameters. They cover the AMM and pool types (GAMM, concentrated liquidity, stableswap, CosmWasm pools, pool manager), incentives and staking (incentives, pool incentives, lockup, superfluid, valset preference), economics (mint, txfees, ProtoRev), governance, TWAP, epochs, the token factory, and the IBC middleware (hooks, rate limiting).
Concentrated Liquidity
Background
CosmWasm Pool
Overview
Downtime-detector
For several use cases, we need a module that can detect when the chain is recovering from downtime. We want to be able to efficiently know "Has it been RECOVERYPERIOD minutes since the chain has been down for DOWNTIMEPERIOD", and expose this as a query to contracts.
Epochs
Abstract
GAMM
2 items
Gov
The gov module enables on-chain governance which allows Osmosis token holders to participate in a community led decision-making process. For example, users can:
IBC-hooks
Wasm Hooks
IBC Rate Limit
The IBC Rate Limit module is responsible for adding a governance-configurable rate limit to IBC transfers.
Incentives
Abstract
Lockup
Abstract
Mint
The mint module is responsible for creating tokens in a flexible way to reward
Orderbook
The Osmosis orderbook is a CosmWasm contract that implements a sumtree-backed limit-order venue. Each market is its own contract instance with one quote denom and one base denom, and the contract participates in the chain's pool routing graph alongside CFMM (Balancer-style weighted and stableswap) and concentrated liquidity pools.
Pool Incentives
Abstract
Pool Manager Module
The poolmanager module exists as a swap entrypoint for any pool model
Superfluid Staking
Abstract
Token Factory
The tokenfactory module allows any account to create a new token with
TWAP
Time Weighted Average Price
Txfees
The txfees modules allows nodes to easily support many tokens for usage as txfees, while letting node operators only specify their tx fee parameters for a single "base" asset.
Validator-Set Preference
Abstract
Module Accounts
All modules have their own module account. Think of this as a wallet that can only be controlled by that module. Here are a few with their respective wallet addresses and permissions:
Name | Address | Permissions |
|---|---|---|
| transfer | osmo1yl6hdjhmkf37639730gffanpzndzdpmhxy9ep3 | minter, burner |
| bonded_tokens_pool | osmo1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3aq6l09 | burner, staking |
| not_bonded_tokens_pool | osmo1tygms3xhhs3yv487phx3dw4a95jn7t7lfqxwe3 | burner, staking |
| developer_vesting_unvested | osmo1vqy8rqqlydj9wkcyvct9zxl3hc4eqgu3d7hd9k | minter |
| gov | osmo10d07y265gmmuvt4z0w9aw880jnsr700jjeq4qp | burner |
| distribution | osmo1jv65s3grqf6v6jl3dp4t6c9t9rk99cd80yhvld | none |
| lockup | osmo1njty28rqtpw6n59sjj4esw76enp4mg6g7cwrhc | minter, burner |
| incentives | osmo1krxwf5e308jmclyhfd9u92kp369l083wequge6 | minter, burner |
| gamm | osmo1c9y7crgg6y9pfkq0y8mqzknqz84c3etr0kpcvj | minter, burner |
| mint | osmo1m3h30wlvsf8llruxtpukdvsy0km2kum8q25g3j | minter, burner |
| claim | osmo1m5dncvfv7lvpvycr23zja93fecun2kcv226glq | minter |
| poolincentives | osmo1upfuxznarpja3sywq0tzd2kktg9wv8mcc0rlm9 | none |
| fee_collector | osmo17xpfvakm2amg962yls6f84z3kell8c5lczssa0 | none |
Module Flow
While module functions can be called in many different orders, here is a basic flow of module commands to bring assets onto Osmosis and then add/remove liquidity:
- (IBC-Transfer) IBC Received
- (GAMM) Swap Exact Amount In
- (GAMM) Join Pool
- (lockup) Lock-tokens
- (superfluid) Calculate and delegate synthetic Osmo
- (lockup) Begin-unlock-tokens
- (GAMM) Exit Pool