Trading Module-Institutional Depth 📈
4.1 Trade Lifecycle
The trading lifecycle in HFDX is fully on-chain and deterministic:
Wallet Connection & Authentication — Users connect via EOA or smart wallet, ensuring transaction integrity.
Market Selection — Predefined risk parameters, including leverage limits, margin requirements, and asset eligibility.
Trade Submission via Router — Central execution gateway enforces atomicity of order placement.
Initial Margin Validation — Ensures sufficient collateral before position creation.
Liquidity Reservation — Allocates pool liquidity to back the leveraged trade.
Position Creation & On-Chain Recording — Smart contracts log all position parameters, including collateral, notional, and leverage.
Continuous Monitoring & Funding Accrual — Funding rates are applied continuously to maintain perpetual price alignment.
Voluntary Close or Forced Liquidation — Positions may be closed by users or liquidated based on maintenance margin thresholds.
4.2 Margin & Liquidation Mechanics
Initial Margin (IM):
Maintenance Margin (MM):
Liquidation Condition:
Liquidation Price (Simplified Long Position):
These formulas quantify the risk envelope for each trade and allow predictable liquidation mechanics, essential for institutional risk management.
4.3 Funding Rate Model
Funding rates align perpetual prices with the external spot index:
Where:
k — Dampening coefficient controlling rate sensitivity
Min/Max — Thresholds that prevent extreme capital outflows during volatility
Funding is applied periodically, creating a self-correcting mechanism that stabilizes the perpetual market.
Last updated