Neutron Modules
Neutron offers several specialized modules that provide unique functionality for developers building on the platform. Each module is designed to solve specific problems commonly encountered in DeFi applications.
DeFi Modules
These modules are designed for direct integration with your smart contracts and DeFi applications:
Query data from any IBC-connected blockchain
Execute transactions on remote chains via ICA
Schedule automated contract executions
Safe IBC acknowledgment handling
Decentralized exchange functionality
Staking hooks for historical voting power
IBC transfers with contract callbacks
Create and manage custom tokens
General Message Passing protocol
System Modules
These modules handle chain-level operations and are primarily managed through governance:
DAO governance operations
Validator compensation system
NTRN burning & treasury management
IBC relayer incentives
Network protection mechanisms
Asset price management for fee calculations
Network-wide minimum gas prices
Integration Patterns
Most Neutron modules follow consistent patterns when used in CosmWasm smart contracts:
1. Import Dependencies
use neutron_sdk::interchain_queries::...; // for ICQ
use neutron_sdk::bindings::...; // for other modules
2. Create Messages
let msg = NeutronMsg::RegisterInterchainQuery { ... };
3. Handle Callbacks
#[entry_point]
pub fn sudo(deps: DepsMut, env: Env, msg: SudoMsg) -> StdResult<Response> {
match msg {
SudoMsg::ModuleCallback { ... } => { ... }
_ => Err(StdError::generic_err("unsupported sudo message")),
}
}
Documentation Structure
Each module provides comprehensive documentation following the Divio system:
- Overview: Core concepts and capabilities
- Explanation: Detailed mechanisms and architecture
- How-to Guides: Step-by-step instructions
- Reference: Complete API and technical specifications