> For the complete documentation index, see [llms.txt](https://onex-3.gitbook.io/onex-document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onex-3.gitbook.io/onex-document/swap/ai-intelligence.md).

# Ai intelligence

## 23. AI Market Regime Detection

The system continuously classifies the current market environment using a **Hidden Markov Model** trained on historical price data, volume profiles, funding rates, and on-chain flow metrics.

| Market Regime    | System Response                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| Bullish Trending | Momentum signals activated, LP fee buffers adjusted, arbitrage sensitivity increased                              |
| Bearish Trending | Risk warnings elevated, protective option suggestions surfaced, leverage warnings increased                       |
| Sideways / Range | Range-bound LP strategies highlighted, options volatility selling strategies shown (V2)                           |
| High Volatility  | Fee buffers increased to protect LPs from impermanent loss, execution splitting recommended                       |
| Liquidity Stress | Spread widening alert, emergency exit paths surfaced. *Note: This indicator may lag the onset of genuine crises.* |

***

## 24. Causal AI Predictive Price Intelligence

### Correlational AI vs. Causal AI

A correlational model says: *"ETH and BTC move together."*

A causal model says: *"This ETH move is caused by ETH-specific ecosystem news, not BTC — therefore BTC is unlikely to follow."*

This distinction is critical for trade quality.

### Technical Methodology

| Component              | Technology                                                                                 |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| Causal Inference Layer | DoWhy library implementing structural causal models                                        |
| Pattern Recognition    | LSTM Neural Networks for historical price context                                          |
| Order Flow             | Real-time demand pressure using VPIN (Volume-Synchronized Probability of Informed Trading) |
| Cross-Asset Graph      | Multi-token causal relationship modeling — updated weekly                                  |

### Prediction Accuracy Tracker — Transparency Feature

Live dashboard showing historical accuracy of all ONEx AI predictions:

* Directional accuracy %
* Mean absolute error
* Percentage of actual prices falling within predicted range
* Updated daily with 30-day rolling window
* Full historical data downloadable

> *If the model is genuinely good, publishing real accuracy data is our strongest competitive advantage. If it is not good, this forces improvements before users rely on it.*

***

## 25. On-Chain Verifiable AI (ZK-Proven Inference)

ONEx is the first DEX to make its AI decisions **independently verifiable** using Zero-Knowledge Proofs.

When the AI makes a recommendation or executes an automated action, it generates a ZK proof that any user can verify without revealing the model weights.

### What the ZK Proof Guarantees

* The recommendation was made by model version X (hash verified on-chain)
* The inputs used were exactly these market signals at this timestamp
* The model weights have not been altered since the last governance-approved update
* The output was not tampered with between inference and display

**Technical implementation:** RISC Zero or SP1 zkVM for ZK-verifiable execution of AI inference. On-Chain AI Model Registry stores model hashes in a governance-controlled smart contract.

***

## 26. Explainable AI Dashboard

Every AI decision includes complete, transparent reasoning visible to the user. Uses **SHAP (SHapley Additive exPlanations)** values for feature attribution — showing exactly which signals contributed to each decision and by how much.

### Capital Movement Thresholds — Safety Governance

| Threshold          | Requirement                                                 |
| ------------------ | ----------------------------------------------------------- |
| Up to $50,000      | AI autonomous action (within user-approved strategies)      |
| $50,000–$500,000   | Requires explicit user approval per action                  |
| Above $500,000     | Requires multi-sig DAO governance approval                  |
| Emergency override | Users can pause all AI automation instantly from any device |

***

## 27. Behavioral Finance AI + Tilt Detection

### Cognitive Bias Detection Library

| Bias              | Detection Method                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Confirmation Bias | One-sided research patterns — only reading bullish or bearish signals                                                          |
| Anchoring         | Pricing decisions anchored to irrelevant reference points (e.g., purchase cost)                                                |
| Sunk Cost Fallacy | Holding losing positions disproportionately longer than winners                                                                |
| FOMO Trading      | Entering positions within 30 minutes of sharp rallies without planned entry                                                    |
| Recency Bias      | Overweighting most recent outcomes in strategy decisions                                                                       |
| Tilt Detection    | Sequence modeling detects revenge trading after losses — escalating position sizes, shortened time between trades after a loss |

> **PRIVACY GUARANTEE:** All behavioral analysis is performed locally in the user's browser. Raw trading behavior data is never uploaded to ONEx servers without explicit opt-in consent.

***

## 28. Federated Learning Behavioral Engine

ONEx uses **Federated Learning** to improve its behavioral AI models without ever accessing raw user trading data. Only mathematical gradient updates (not data) are aggregated.

This is the only privacy-compliant approach to training behavioral AI on user data at scale.

***

## 29–35. Additional AI Intelligence Features

| Feature                                    | Technical Specification                                                                                                                                                                                        |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Social Sentiment Signals**               | Twitter/X (Enterprise API), Reddit, Discord, Telegram. NLP pipeline with 5–30 second latency. Used for 1-hour+ predictions only. NOT connected to automated execution.                                         |
| **AI Narrative & Sector Rotation Tracker** | Monitors narrative momentum across DeFi sectors (AI tokens, DePIN, RWA, L2, DeFi Blue Chips) using on-chain capital flow + social sentiment. Informational only.                                               |
| **AI Portfolio Immune System**             | Detects stablecoin depegs (price below $0.995 on 3+ oracle sources), known exploit patterns, concentration risk when >30% in a single protocol. Issues alerts — does not act autonomously.                     |
| **Personalized AI Trading Assistant**      | Natural language interface for informational queries and strategy exploration. Voice commands limited to informational use — not trade execution (2–5 second processing latency creates price execution risk). |
| **Reinforcement Learning Market Making**   | RL agent learns optimal fee schedules from historical LP return data. Updated weekly via governance vote. Provides better LP returns across all market regimes than static parameters.                         |
| **Autonomous LP AI Agents**                | Auto-rebalances LP position ranges, exits during extreme volatility events. Built on proven infrastructure (Gamma Strategies / Arrakis Finance model). Users set risk parameters; agent operates within them.  |
| **Governance Assistant AI**                | Summarizes governance proposals, analyzes economic impact, surfaces relevant historical precedents. Advisory only — cannot vote or submit proposals autonomously.                                              |
