Autonomous Margin Layer
The Autonomous Margin Layer (AML) is Liquiβs intelligent module for margin trading, combining AI agents and smart contracts deployed on MegaETH.
AML enables adaptive leveraged trading by dynamically adjusting position parameters based on market conditions, user behavior, and real-time risk evaluation.
AML Components
AI Agents:
Analyzes market data in real time (price, volatility, liquidity, trader activity)
Determines leverage, liquidation thresholds, and position risk profile
Oracle Layer:
Relays AI decisions to smart contracts on MegaETH
Can use multisig or custom oracle implementation
Smart Contracts:
Enforce AI recommendations: open positions, adjust leverage, trigger liquidation
Use isolated collateral storage and dynamic margin levels
How It Works:
The user initiates a margin position through the Liqui interface
The AI agent evaluates acceptable leverage, risk score, and liquidation threshold
The parameters are signed and sent to the contract
The smart contract executes the position under those constraints
The AI continuously monitors the position and suggests updates or closure when needed
AI Feedback & Security
All AI decisions include a signature and hash, verified on-chain
Historical data feeds back into model improvement
Contracts include failsafes: halts, freezes, risk boundary checks
Last updated