Implements comprehensive DEX infrastructure: - contracts/perps (81KB WASM): - Long/Short positions with 2x-100x leverage - Funding rate mechanism (keeps price anchored to spot) - Liquidation engine with insurance fund - Mark price (EMA) vs index price (oracle) - Maintenance margin (0.5%) and initial margin (1%) - contracts/oracle (80KB WASM): - Multi-source price aggregation (median) - TWAP (Time-Weighted Average Price) - Stale price detection - Confidence intervals - contracts/aggregator (94KB WASM): - Cross-chain liquidity routing via IBC - Best price discovery across multiple DEXs - Split routing for large orders - Zero-capital model (aggregation fees only) This enables dYdX/GMX-style trading without requiring capital. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||