Mechanism
AZEx Mechanism & Architecture Design
Protocol Positioning & Design Goals
AZEx is a new-generation Peer-to-Pool perpetual AMM protocol — not a hybrid of Orderbook and AMM, but an AMM design with an embedded dynamic price discovery algorithm that reacts in real time to spot market conditions and adapts perpetual contract pricing accordingly.
Core goals:
Full Decentralization – Permissionless listing, no centralized access control.
Closed-loop Mechanism – Price discovery, liquidation, and liquidity management are all executed on-chain.
Fairness First – Execution paths are fully verifiable, with no backdoor pricing or sequencing manipulation.
Capital Efficiency Boost – Break through the TVL leverage ceiling of traditional Peer-to-Pool designs while keeping risk under control.
Price Discovery: Spot × Algorithm Closed Loop
AZEx’s mark price is determined by two components:
Spot Price – Directly sourced from the Uniswap v4 spot pool (azUSD/BaseToken).
Dynamic Price Impact Adjustment – A non-linear adjustment based on net position and liquidity conditions.
Core Formula:
markPrice = spotPrice × (1 + impactSign × α × (netOI / impactCapacity)^β)
spotPrice: From the Uniswap v4 spot pool
impactSign: +1 for long dominance, -1 for short dominance
netOI: |longOI - shortOI|
impactCapacity: Liquidity-based “absorption capacity” against net position pressure
α (alpha): Price impact strength coefficient
β (beta): Non-linear gain coefficient
impactCapacity Calculation:
impactCapacity = k1 × spotLiquidity + k2 × perpLiquidity
spotLiquidity: Total azUSD + BaseToken near the current tick in the spot pool (USD value)
perpLiquidity: Available azUSD balance in the perp pool (USD value)
k1/k2: Adjustable weighting factors
This mechanism ensures:
Long/short imbalance simulates AMM-like slippage, pushing markPrice up or down.
When positions rebalance, markPrice naturally converges to the spot price.
Price impact strength dynamically adjusts to liquidity and position changes.
Liquidation & Risk Management
AZEx’s liquidation model is built on a core premise: negative equity is impossible by design — traders cannot lose more than their margin.
On top of this foundation, AZEx introduces:
Decentralized Multi-node Keeper Network – Multiple nodes execute liquidations in parallel, ensuring responsiveness even during extreme volatility. Keeper failure does not block liquidations.
On-chain Auto-Deleveraging (ADL) – A novel ADL mechanism that can process all targeted positions within a single block, despite gasLimit constraints, rapidly restoring market balance.
LP Loss Protection:
LP drawdowns are capped at a preset threshold;
If spot liquidity falls below safety levels, the market automatically delists, preventing further exposure.
Capital Efficiency Optimization
Thanks to the ADL mechanism, AZEx implements a long-short offset OI model:
LPs only take the net position as counterparty risk;
Long and short OI can theoretically expand without limit;
OI is decoupled from LP TVL, dramatically improving capital efficiency.
AzUsd Accounting System:
AzUsd is the unit of margin and settlement for perpetual trading;
1:1 convertible with USDC, ensuring stability and liquidity;
Users can deposit any token via Uniswap swaps into AzUsd;
Underlying assets are deployed into yield strategies such as Ethena, Aave, Morpho, 0xFluid;
Yields are distributed proportionally to LPs and the protocol treasury.
Decentralized Oracle (Hook-Based Oracle)
AZEx’s price discovery system is not a traditional standalone oracle — it is embedded into Uniswap v4 via the Hook mechanism, creating a direct, real-time coupling between the spot market and the perpetual market.
Core Mechanism:
Spot Trading & Liquidity Change Feedback
Hooks capture Swap, Mint, ModifyLiquidity events in the spot pool (AzUsd/BaseToken);
Dynamically adjust markPrice parameters (impactCapacity, α, β) to reflect liquidity changes.
Incorporating OI & Net Position
Hooks read longOI, shortOI, and netOI in real time;
Feed these into the markPrice formula so that long-short imbalances instantly adjust price deviation from spot.
Instant On-chain Updates
Price updates occur in the same execution cycle as the triggering event — no external pushes needed.
Chain-native Enhancements
Truncated Oracle: Caps extreme jumps to prevent oversized impact from single trades;
TWAP Oracle: Smooths short-term volatility and mitigates stop-hunting.
Fully On-chain Closed Loop
No reliance on external price sources;
Functions like an on-chain “basis” mechanism, combining spot depth and OI for perpetual price discovery.
LP Risk Management
LP protection in AZEx is powered by the same Hook-native risk control that underpins price discovery, with every risk-related action — Swap, liquidity addition, position opening/closing — undergoing pre-execution simulation.
Core Mechanism:
Full Simulation Before Execution – Simulates the impact on markPrice, position structure, netOI, and LP risk exposure using the same parameters as live execution.
Threshold Control – If the simulated result exceeds the LP risk threshold, the system either rejects the action or triggers risk-mitigating liquidations first.
Extreme Protection – In cases of severe spot liquidity drop or excessive systemic risk, the market will auto-delist, halting new positions until safety is restored.
Future External Hedging Vaults – Optional auto-hedging vaults will be offered in the future, enabling LPs to proactively reduce net position exposure. These vaults are external and decoupled from the core AMM logic.
Advantages:
Native on-chain risk control — no reliance on off-chain monitoring;
Transparent and predictable protection rules;
Fast containment of extreme scenarios to safeguard LP capital.
Summary
AZEx integrates price discovery, liquidation, capital efficiency, and risk management into a fully on-chain closed-loop system through a new AMM-based Peer-to-Pool architecture.
Price Discovery – Powered by Uniswap v4 Hooks, directly linking spot depth and perpetual OI to create a native on-chain markPrice mechanism.
Liquidation & ADL – Decentralized multi-node liquidations plus fully on-chain ADL ensure market stability and LP safety under extreme volatility.
Capital Efficiency – LPs only bear net position risk; long/short OI can theoretically expand without limit. Combined with azUsd accounting and yield deployment of underlying assets, capital utilization is greatly enhanced.
Risk Management – Full on-chain pre-execution simulation, threshold-based control, and auto-delisting in extreme cases, complemented by optional external hedging vaults for layered LP protection.
This design not only preserves the permissionless, decentralized, and non-upgradable nature of DeFi protocols but also resolves the three long-standing challenges of traditional Peer-to-Pool perpetuals: permission constraints, oracle fragility, and liquidity inefficiency. Under this architecture, the protocol can support CEX-level Open Interest and trading volume capacity entirely on-chain, while enabling truly permissionless listing — allowing anyone to create and trade perpetual markets for any asset without approval, unlocking a fully open and scalable on-chain derivatives ecosystem.
Last updated