CLOB & AMM
Technical architecture and implementation details of OMNYX's hybrid trading system.
Technical Stack
Omnyx integrates a hybrid trading framework by merging an on-chain trading and risk management system with an off-chain sequencer, creating a cohesive platform for spot, perpetuals, and money market transactions.
This setup, running on the Arbitrum layer, ensures low-latency order matching and a unified risk and collateral management system. By combining automated market makers (AMM) with a traditional orderbook, Omnyx offers a comprehensive DeFi trading solution, enhancing liquidity, performance, and product diversity within a single ecosystem.
This model addresses common limitations of decentralized exchanges, creating a versatile and efficient trading environment.
AMM Implementation
Omnyx's AMM, initially based on the xy=k formula, plans to introduce leveraged liquidity pools, enhancing liquidity alongside its virtual AMM for perpetual contracts.
Positioned on-chain within the protocol layer, Omnyx's AMM operates in "Slo-Mo Mode" as the protocol's default, governed by smart contracts. Its liquidity, integrated with the orderbook's bids and asks, acts as an additional market maker through smart contracts. This liquidity merges with that from automated traders through the sequencer, providing a consolidated liquidity source for user transactions.
Sequencer Orderbook (Off-Chain)
Omnyx's sequencer operates as an off-chain central-limit orderbook (CLOB) node, set to decentralize through governance. It stands as a cornerstone for high-performance trading, with liquidity boosted by LP market positions.
An HFT-compatible API allows for integration into automated trading, leveraging both orderbook and AMM liquidity for rapid transactions. Despite on-chain latency, it rivals centralized exchanges in speed, maintaining 10-30 ms order-matching times.
In emergencies, the on-chain AMM acts as a fallback, allowing trading against AMM liquidity without the orderbook.
Performance Metrics
- •Order Matching: 10-30 milliseconds execution time
- •HFT Compatible: API and SDK for automated trading
- •Fallback System: On-chain AMM for emergency trading
- •Decentralization: Governance-driven decentralization roadmap
Liquidation & Insurance Fund
Liquidation on the exchange is an automated closure of leveraged positions when a trader's margin is too low, similar to a car needing refuel to prevent stalling. It ensures traders' losses don't surpass their initial investment, maintaining the exchange's solvency by settling accounts.
Each exchange has its liquidation protocols, with unique maintenance weights determining market risk profiles. Liquidations on Omnyx occur at mark prices from Chainlink, a third-party oracle, ensuring accurate and fair price references. This system, along with risk management tools, safeguards against volatility and underfunded positions.
Liquidation Price
When liquidators aim to close a subaccount, they choose the product and amount for liquidation. The liquidation price is midway between the oracle and maintenance weight-determined prices.
- •For long positions, the liquidation price is the oracle price adjusted by the maintenance asset weight
- •For short positions, it's adjusted by the maintenance liability weight
- •Omnyx retains 25% of liquidators' profits for the insurance fund
Insurance Fund
Omnyx maintains platform creditworthiness through a segregated USDC pool, the Insurance Fund, initially funded by the core team and later supplemented by liquidation revenues.
This fund covers shortfalls in bankrupt accounts, preventing loss socialization. If the fund depletes, losses may be socialized first among perpetual account holders in the affected market, and then, if necessary, among all USDC holders.
- •Initial Funding: Core team provides initial capital
- •Revenue Source: 25% of liquidation profits
- •Purpose: Cover shortfalls in bankrupt accounts
- •Fallback: Loss socialization mechanism if fund depletes
On This Page
