Pricing Model
Oracle-Based Pricing
Price Sources
struct PriceData {
int256 price; // Asset price in USD (8 decimals)
uint256 timestamp; // Last update timestamp
bool valid; // Price validity flag
}Price Validation
function getValidatedPrice(bytes32 assetId) external view returns (uint256) {
(int256 price, uint256 timestamp, bool valid) = oracle.getPrice(assetId);
require(valid, "Invalid price feed");
require(price > 0, "Price must be positive");
require(timestamp > block.timestamp - MAX_PRICE_AGE, "Price too stale");
return uint256(price);
}Pricing Mechanics
Mint Pricing (DUSD → Synthetic)
Burn Pricing (Synthetic → DUSD)
Swap Pricing (Synthetic ↔ Synthetic)
Dynamic Fee System
Risk-Based Fee Structure
Operation
Risk Level
Fee Type
Rationale
Dynamic Burn Fee Calculation
Fee Schedule
Stress Ratio
Burn Fee
Protocol State
Stress Ratio Calculation
Protocol Solvency Protection
Hard Invariant Enforcement
Dynamic Backing Calculation
Real-Time Monitoring
Settlement Lock Impact on Pricing
MEV Protection Mechanism
Price Stability Benefits
User Experience Considerations
Price Feed Management
Oracle Integration
Multi-Source Aggregation
Price Precision and Calculations
Decimal Handling
Rounding Protection
Real-Time Price Updates
Price Freshness Requirements
Update Mechanisms
Market Hours Handling
Trading Hours Integration
After-Hours Pricing
Price Deviation Protection
Circuit Breakers
Volatility Adjustments
Integration Examples
Price Display Component
Dynamic Fee Calculator
Protocol Health Monitor
Risk Management
Oracle Failure Handling
Price Manipulation Protection
Performance Optimization
Gas-Efficient Price Queries
Caching Strategies
Last updated