Trading Mechanics
Perpetual trading on AZX is powered by a coordinated set of trading and pricing mechanisms that work together to ensure fair execution, accurate pricing, and consistent position management.
This section provides a high-level overview of how orders are matched, prices are determined, and profit and loss (PNL) is calculated within the perpetual trading system.
System Architecture Overview
At a high level, the perpetual trading system consists of four core components:
Order Matching
Price Determination
Position Lifecycle Management
PNL Calculation
These components operate together to deliver a unified and transparent trading experience across the AZ ecosystem.
Order Matching
Order matching governs how buy and sell orders interact within the order book.
Key characteristics include:
Orders are matched based on price-time priority
Matching occurs within a unified order book shared across the AZ ecosystem
Execution behavior is consistent regardless of the frontend used
Order matching ensures that trades are executed fairly and deterministically under the same market conditions.
For details on execution logic and matching priority, refer to Order Matching.
Price Determination
Accurate pricing is critical for perpetual trading, particularly for margin calculation and liquidation risk management.
AZX uses multiple price references, each serving a distinct purpose:
Index Price Reflects the aggregated spot price of the underlying asset from external markets
Mark Price A derived price used for PNL calculation and liquidation triggers, designed to reduce manipulation and short-term volatility
By separating execution price from risk management price, AZX enhances market stability and protects traders from unnecessary liquidations.
For detailed explanations, refer to Index Price and Mark Price.
Position Lifecycle
Once an order is executed, it becomes part of a trader’s position.
The position lifecycle includes:
Position opening through trade execution
Position size adjustments via subsequent trades
Realized PNL when positions are partially or fully closed
Unrealized PNL based on current mark price
Position closure through voluntary execution or liquidation
Position state is continuously updated as prices and trades evolve.
For a detailed walkthrough, refer to Position Lifecycle.
PNL Calculation
Profit and loss (PNL) reflects the financial outcome of a trader’s positions.
PNL is calculated based on:
Entry price
Exit price or current mark price
Position size and direction
Applicable fees and funding payments
PNL calculation is integral to margin evaluation and risk management processes.
For calculation methodology and examples, refer to PNL Calculation.
Relationship to Risk Management
The trading mechanics described above directly feed into the platform’s risk management systems.
Mark price informs liquidation thresholds
PNL impacts available margin
Position size influences leverage and risk exposure
These mechanics form the foundation upon which margin requirements, liquidation logic, and system-wide safeguards operate.
Navigating This Section
The following pages provide detailed coverage of each trading mechanic:
Order Matching
Index Price
Mark Price
Position Lifecycle
PNL Calculation
Each page focuses on a single mechanism and its role within the broader perpetual trading system.
Summary
Trading mechanics on AZX are designed as an integrated system rather than isolated components. By coordinating order matching, pricing references, position tracking, and PNL calculation, AZX ensures transparent execution and robust risk-aware trading within the perpetual market.
Last updated

