Governance Crate
A comprehensive governance system for decentralized decision-making in the Neural Trader platform.
Features
🗳️ Proposal Management
-
Multiple Proposal Types:
- Parameter Changes
- Strategy Approvals
- Risk Limit Adjustments
- Emergency Actions
- Treasury Allocations
- Member Management
-
Proposal States: Draft, Active, Passed, Rejected, Executed, Expired, Vetoed
-
Metadata Tracking: Title, description, proposer, timestamps
👥 Member Management
-
Role-Based Access Control:
- Admin: Full proposal, voting, and execution rights
- Guardian: Can veto proposals, full voting rights
- Member: Can propose and vote
- Observer: Read-only access
-
Voting Power: Stake-based or role-based weighting
-
Reputation System: Automatic reputation tracking based on participation
-
Delegation: Members can delegate voting power to others
🗳️ Voting Mechanisms
- Vote Types: For, Against, Abstain
- Weighted Voting: Voting power based on stake/shares/reputation
- Quorum Requirements: Minimum participation threshold
- Passing Threshold: Configurable approval percentage (e.g., 66%)
- Vote Delegation: Transfer voting power to trusted members
⚙️ Execution System
- Automatic Execution: Execute proposals after passing
- Time-Locked Execution: Delay period before execution
- Veto Mechanism: Guardian/admin override capability
- Execution Validation: Verify proposal state and permissions
💰 Treasury Integration
- Budget Allocation: Governance-controlled fund allocation
- Fund Withdrawal: Multi-signature treasury access
- Emergency Fund: Reserved funds for critical situations
- Transaction History: Complete audit trail
Installation
Add to your Cargo.toml:
[]
= { = "../governance" }
= "1.33"
Quick Start
use ;
use Decimal;
Examples
Run the comprehensive demo:
Testing
Run the test suite:
# All tests (20+ tests)
# Specific test files
Documentation
For complete API documentation and advanced usage, see the inline documentation:
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.