A decentralized prediction market platform aiming to democratize Move packages security through community-driven prediction market.
Each package has its own prediction market, enabling users to express confidence or suspicion by buying or selling market tokens.
Coral leverages market mechanisms to aggregate subjective risk assessments of Move packages, similar to how traditional financial markets operate. The platform creates binary prediction markets (SAFE/RISKY) for each package, where community sentiment drives price discovery and reveals collective security insights.
- Per-Package Markets: Automatically deploy prediction markets for Move packages
- LMSR Market Making: Logarithmic Market Scoring Rule ensures liquidity and fair pricing
- Community Risk Assessment: Aggregate security insights through market participation
- Real-time Sentiment: Live pricing reflects current community confidence levels
- Modular Architecture: Separates market making, trading logic and other components.
- Comprehensive Events: Full audit trail of all market activities
The platform is built with a modular architecture that separates core concerns:
coral/
βββ sources/
β βββ market.move # Market creation and lifecycle management
β βββ lmsr.move # Market maker algorithm (swappable)
β βββ outcome.move # Outcome management
β βββ math.move # Mathematical utilities
β βββ registry.move # Market registry and metadata (future)
βββ tests/
βββ market_tests.move # Core market functionality tests
βββ pricing_test.move # LMSR algorithm validation
βββ tusd.move # Test collateral token
Coral implements the Logarithmic Market Scoring Rule (LMSR) for automated market making:
C(q) = b Γ ln(β exp(qα΅’ / b))
P(SAFE) = exp(q_safe/b) / (exp(q_safe/b) + exp(q_risky/b))
P(RISKY) = 1 - P(SAFE)
Benefits:
- Guaranteed Liquidity: Always-available trading without order books
- Bounded Loss: Maximum subsidy is predictable (b Γ ln(2))
- Proper Scoring: Incentivizes truthful probability reporting
- Efficient Pricing: Prices reflect aggregated market beliefs
- Package Upload: New Move package deployed to Sui
- Market Creation: Binary prediction market (SAFE/RISKY) automatically created
- Community Trading: Users buy/sell tokens based on security assessment
- Price Discovery: Market prices reflect collective risk evaluation
- Insight Generation: Developers and users gain security insights
- High SAFE Prices: Community confidence in package security
- High RISKY Prices: Community suspects potential vulnerabilities
- Trading Volume: Indicates strength of conviction
- Price Volatility: Uncertainty or new information incorporation
- Browse and search Move packages by safety score
- Filter by risk level, trading volume, or recent activity
- View package metadata, audit status, and market metrics
- One-click buy/sell for SAFE/RISKY tokens
- Real-time price calculations and slippage protection
- Portfolio management across multiple package markets
- Position tracking and profit/loss analysis
- Ecosystem-wide risk overview and trending packages
- Community alerts for rapid sentiment changes
- Historical price charts and trading analytics
- Developer reputation and package comparison tools
public fun create_package_market<SAFE: drop, RISKY: drop, C>(
package_info: PackageMetadata, // Package details and version info
collateral_metadata: &CoinMetadata<C>, // Trading collateral (USDC, SUI, etc.)
liquidity_param: u64, // LMSR liquidity parameter
blob_id: ID, // Market description and metadata
clock: &Clock,
ctx: &mut TxContext
): (Market, MarketManagerCap)// Initialize market snapshot for consistent pricing
let snapshot = market::initialize_outcome_snapshot(&market);
market::add_outcome_snapshot_data<SAFE>(&market, &mut snapshot, safe_outcome);
market::add_outcome_snapshot_data<RISKY>(&market, &mut snapshot, risky_outcome);
// Execute trade with slippage protection
let (shares, change) = market::buy_outcome<SAFE, USDC>(
&mut market,
snapshot,
payment_coin,
safe_outcome,
amount,
max_cost,
&clock,
ctx
);Comprehensive events track all platform activity:
- MarketCreated: New package market deployment
- OutcomePurchased/Sold: All trading activity with details
- MarketResolved: Final outcome determination
- ConfigUpdated: Platform parameter changes
# Run all tests
sui move test- Market Lifecycle: Creation, trading, resolution, closure
- LMSR Algorithm: Price accuracy under various conditions
- Edge Cases: Extreme market conditions and error handling
- Access Controls: Admin functions and security validations
- Event Emission: Comprehensive activity logging
- Sui CLI and development environment
- Move compiler and testing framework
# Clone repository
git clone https://github.com/0xDraco/Coral.git
cd Coral/packages/coral
# Build contracts
sui move build
# Run test suite
sui move test
# Deploy to testnet
sui client publish --gas-budget 100000000
# Deploy to mainnet
sui client publish --gas-budget 100000000 --network mainnet- Risk Assessment: Understand community perception of package security
- Competitive Analysis: Compare safety perception across similar packages
- Security Incentives: Market feedback drives better security practices
- Reputation Building: Consistent safety record builds market confidence
- Due Diligence: Community-sourced security insights before integration
- Risk Management: Quantified safety scores for technical decisions
- Discovery: Find trusted packages through positive market signals
- Early Warning: Rapid detection of potential security concerns
- Monetized Research: Profit from identifying package vulnerabilities
- Information Sharing: Signal security concerns to broader community
- Reputation Building: Build credibility through accurate predictions
- Ecosystem Service: Contribute to overall Move ecosystem security
- Modular Design: Isolated components minimize upgrade risks
- Access Controls: Multi-signature admin functions where needed
- Pause Mechanisms: Emergency stops for critical issues
- Comprehensive Testing: Extensive test coverage for all scenarios
- Parameter Management: Community input on market parameters
- Market Resolution: Clear processes for outcome determination
- Upgrade Proposals: Transparent enhancement and bug fix procedures
- Dispute Resolution: Fair handling of edge cases and conflicts
- Information Markets: Traders profit from superior security knowledge
- Incentive Alignment: Accurate risk assessment generates returns
- Community Participation: Low barriers to entry encourage broad involvement
- Continuous Discovery: 24/7 price updates reflect new information
- Trading Fees: Small percentage of trade volume supports platform
- Market Creation: Fees for deploying new package markets
- Value Creation: Security insights benefit entire ecosystem
- Network Effects: More participants improve signal quality
- System Design: Detailed component interactions and data flows
- Module Specifications: Complete API documentation for all contracts
- Integration Guides: How to connect external systems and frontends
- Upgrade Procedures: Safe contract enhancement methodologies
- Trading Guide: How to participate in prediction markets
- Developer Guide: Integrating package safety scores into workflows
- API Reference: Complete interface documentation
- Troubleshooting: Common issues and resolution procedures
- β Binary prediction markets for packages
- β LMSR automated market making
- β Comprehensive event system
- β Basic admin controls and testing
- Multi-outcome markets (beyond binary)
- Package version tracking and comparison
- Audit integration and professional assessments
- Advanced analytics and historical data
- Cross-package dependency risk analysis
- Governance token and decentralized management
We welcome contributions from the Move and Sui ecosystem:
- Code Contributions: Bug fixes, feature enhancements, optimizations
- Testing: Additional test cases and edge case validation
- Documentation: User guides, tutorials, and technical documentation
- Research: Economic modeling, security analysis, and algorithm improvements
- Fork repository and create feature branch
- Implement changes with comprehensive tests
- Submit pull request with detailed description
- Code review and collaborative improvement
- Integration and deployment