Creek Protocol is a comprehensive DeFi lending and staking protocol built on the Sui blockchain. It provides users with the ability to deposit collateral, borrow stablecoins, stake XAUM tokens for rewards, and access flash loans.
The protocol consists of several key components:
- Core Protocol: Main lending and borrowing functionality
- Coin System: Custom tokens (GR, GY, GUSD) with specific roles
- Oracle System: Multi-source price feeds with XAUM integration
- Staking System: XAUM staking for GR and GY token rewards
- Libraries: Shared utilities for math, decimals, and data structures
- Purpose: Stability token pegged to gold's moving average price that captures gold's stable value.
- Supply: Dynamic supply controlled by StakingManager
- Decimals: 9
- Minting: Only through XAUM staking
- Purpose: Volatility token pegged to gold's price fluctuations that captures gold's volatility value.
- Supply: Dynamic supply controlled by StakingManager
- Decimals: 9
- Minting: Only through XAUM staking
- Purpose: Protocol's native stablecoin for borrowing
- Supply: Dynamic supply controlled by Market
- Decimals: 9
- Minting: Through borrowing against collateral
- Collateralization: Backed by GR tokens and other assets
- Users can deposit various supported assets as collateral
- Collateral is stored in user-specific obligations
- Each collateral type has specific risk parameters
- Users can borrow GUSD against their collateral
- Borrowing is subject to collateralization ratios and limits
- Interest accrues on borrowed amounts
- Only GUSD can be borrowed (single-borrow model)
- Users can repay borrowed amounts plus accrued interest
- Partial repayments are supported
- Interest is calculated using dynamic interest models
- Users can withdraw collateral as long as health factor remains > 1
- Withdrawal amounts are limited by risk parameters
- Automatic health checks prevent over-withdrawal
- Stake XAUM tokens to earn GR and GY tokens
- Fixed exchange rate: 1 XAUM = 100 GR + 100 GY
- Minimum stake amount: 0.001 XAUM
- Staking and unstaking fees are configurable
- Centralized management of staking operations
- Controls GR and GY token supplies
- Manages XAUM pool and fee collection
- Admin-controlled fee rates
- Primary and secondary price feed validation
- Support for multiple oracle providers:
- Pyth Network
- Supra Oracle
- Switchboard
- Manual rules
- Price validation with 1% tolerance between sources
- Special pricing logic for XAUM-based assets
- EMA (Exponential Moving Average) calculations
- GR token pricing based on XAUM indicators
- Cached price computations for efficiency
- Borrow assets without collateral for single transaction
- Must be repaid in the same transaction
- Single transaction cap: 50,000 GUSD (configurable)
- Soft liquidation mechanism
- Liquidators can repay debt and receive collateral
- Liquidation amounts calculated to restore health factor to 1
- Liquidation penalties and discounts are configurable
- Central market object managing all protocol state
- Risk parameter management
- Asset activation controls
- Pause/unpause functionality
- User-specific debt and collateral tracking
- Health factor calculations
- Interest accrual
- Lock/unlock mechanisms for atomic operations
- Collateral factors (max 95%)
- Liquidation factors and penalties
- Configurable parameters
- Time-based accrual
- Exchange Rate: 1 XAUM = 100 GR + 100 GY
- Minimum Stake: 0.001 XAUM
- Fee Structure: Configurable staking/unstaking fees
- Price Validation: 1% tolerance
- Update Frequency: Real-time with staleness checks
- Decimal Precision: 9 decimals for all prices
- Deploy coin contracts (GR, GY, GUSD)
- Deploy oracle system
- Deploy core protocol
- Initialize market and staking manager
- Configure risk parameters and interest models
- Pause Mechanism: Emergency pause functionality
- Version Control: Contract versioning system
- Access Control: Admin-only functions for critical operations
- Oracle Validation: Multi-source price verification
- Health Checks: Continuous monitoring of user positions
The protocol emits comprehensive events for:
- Deposits and withdrawals
- Borrowing and repaying
- Staking and unstaking
- Liquidations
- Price updates
- Parameter changes
[Add license information]
[Add contribution guidelines]
[Add support information]
This protocol is built on Sui blockchain and implements industry-standard DeFi practices with additional innovations in staking and oracle integration.