> 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/trading-infrastructure.md).

# Trading infrastructure

## 1. ONEx Omni-Price Oracle Terminal

Every token on ONEx simultaneously displays its live price from nine independent oracle networks, 20+ DEXs, and 10 CEXs — all within a single trading interface.

### Update frequencies

* On-chain DEX prices: every block (Arbitrum: \~0.25s, Ethereum: \~12s, Solana: \~0.4s, BSC: \~3s)
* CEX prices (Binance, Coinbase, OKX): WebSocket streaming, sub-200ms
* Oracle networks (Chainlink, Pyth): push model, triggered by 0.5% price deviation or heartbeat
* Best execution price calculation: recalculated every 500ms

### 9 Oracle Sources — Decentralized Majority Guaranteed

| Tier                     | Oracles                                               |
| ------------------------ | ----------------------------------------------------- |
| Primary (decentralized)  | Chainlink, Pyth Network, RedStone, Chronicle Protocol |
| Secondary (supplemental) | DIA Protocol, Band Protocol, Tellor, API3, UMA        |

**Consensus rule:** Price is valid only when **5 of 9 sources agree within 1%** — and at least **3 of the agreeing sources must be from the primary decentralized group**. This prevents any centralized source from forming a manipulating majority.

***

## 2. Bridge-Abstracted Cross-Venue Arbitrage Engine

ONEx provides the first DEX-native integrated arbitrage execution terminal spanning both DEX and CEX venues.

### Arbitrage Opportunity Card — What You See

{% content-ref url="/spaces/Qmb07cwIvtTJ0xfz6yHd/pages/BnZv06ue8BmBBNH970w9" %}
[Broken mention](broken://spaces/Qmb07cwIvtTJ0xfz6yHd/pages/BnZv06ue8BmBBNH970w9)
{% endcontent-ref %}

Every opportunity card shows:

* Gross spread, gas costs (chain-specific), bridge/transfer fees, trading fees, slippage estimate
* **Net profit after ALL costs** with chain-specific gas range (e.g., Arbitrum: $0.10–$0.50, Ethereum: $15–$80)
* **Execution Type clearly labeled:**
  * `ATOMIC` — same-chain, zero execution risk
  * `CROSS-CHAIN` — 2–8 min, price risk
  * `CEX-LINKED` — 2–10 min, counterparty risk
* Risk Score incorporating: confirmation delays, bridge risk, CEX counterparty rating, price volatility window
* **Opportunity Freshness Score:** age of detected opportunity with estimated remaining validity window

### Execution Modes

| Mode             | Description                                                        | Target User      |
| ---------------- | ------------------------------------------------------------------ | ---------------- |
| One-Click Manual | User reviews full P\&L breakdown and clicks execute                | Active traders   |
| Semi-Automatic   | AI alerts user; execution awaits approval within timeout           | Moderate traders |
| Fully Automatic  | AI detects and executes without intervention (user-defined limits) | Power users      |
| Bot API Mode     | Programmatic access for custom quantitative strategies             | Developers       |

***

## 3. Same-Chain Flash Arbitrage Engine

ONEx integrates flash loan capabilities enabling fully-funded arbitrage with **zero user capital required**.

{% hint style="warning" %}
**IMPORTANT:** Flash loan arbitrage on ONEx is **same-chain only**. Both the buy and the sell must occur within a single transaction on the same blockchain. This is the only way to guarantee atomicity — if any step fails, the entire transaction reverts and the user pays nothing.
{% endhint %}

### Flash Loan Economics

| Parameter                  | Value                                                                                        |
| -------------------------- | -------------------------------------------------------------------------------------------- |
| Capital required from user | $0.00                                                                                        |
| Flash loan fee             | 0.05% (Aave V3) or 0.00% (Balancer)                                                          |
| Gas cost — Arbitrum        | $0.10–$0.50                                                                                  |
| Gas cost — Ethereum        | $15–$80                                                                                      |
| Gas cost — Solana          | $0.001–$0.01                                                                                 |
| MEV protection             | All flash loan transactions route through private mempools                                   |
| Atomic guarantee           | If sell price moves unfavorably, transaction reverts — user pays only gas for failed attempt |

***

## 4. Neural Arbitrage Network with Causal AI

The Neural Arbitrage Network identifies pre-conditions for arbitrage opportunities **30–120 seconds before they materialize** — not precise price predictions, but high-probability setup detection.

ONEx uses **Causal AI** (based on Judea Pearl's causal inference framework) to distinguish between coincidental correlations and genuine causal relationships.

| Input Signal                      | Role in Causal Model                                                              |
| --------------------------------- | --------------------------------------------------------------------------------- |
| Mempool large pending orders      | Direct causal predictor — large pending buys cause upward price pressure          |
| CEX orderbook imbalances          | Leading indicator — CEX price discovery often precedes DEX moves                  |
| On-Chain whale wallet movements   | Causal signal — large wallet transfers to DEX addresses predict imminent trades   |
| Cross-chain fund flows            | Structural signal — capital moving to a chain precedes trading activity           |
| Options implied volatility shifts | Options market leads spot in informed trading                                     |
| Order Flow Toxicity Score (VPIN)  | Distinguishes informed from uninformed flow                                       |
| Funding rate divergences          | Cross-venue funding gaps create arbitrage setups with high predictive reliability |

***

## 5. Automated Arbitrage Bot — Full Configuration

Users configure persistent arbitrage bots that run continuously without manual intervention. Every bot includes:

* Configurable daily stop-loss
* Maximum trade size
* Minimum net profit threshold
* 90-day historical backtesting before going live

### Opportunity Freshness Score

Every opportunity includes a freshness timestamp:

* "Detected 340ms ago — High confidence opportunity is still valid"
* "Detected 1.8s ago — Verify before executing in this liquidity depth"
* Opportunities older than their estimated validity window are automatically grayed out

{% hint style="warning" %}
**IMPORTANT DISCLOSURE:** Arbitrage opportunities with spreads below 0.2% are typically captured within milliseconds by professional automated systems. The scanner is most valuable for configuring automated bots and monitoring bot performance — not for manual execution of sub-0.2% opportunities.
{% endhint %}

***

## 6–18. Core Trading Infrastructure

| Feature                           | Technical Specification                                                                                                                                  |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Cross-DEX Selling**             | Sell on any supported external DEX from ONEx interface via delegated smart contract. User retains custody until settlement.                              |
| **CEX-Linked Intelligence**       | Read-only API connections to Binance, Coinbase, OKX, Bybit, Kraken, KuCoin, Gate.io, MEXC, Bitget, HTX. Price data and orderbook depth displayed.        |
| **AI Smart Liquidity Management** | Swap fees and liquidity allocation recalibrated every block on L2 chains; every 5 blocks on Ethereum mainnet.                                            |
| **Predictive Liquidity Engine**   | ML models forecast demand 30–90 seconds ahead using order flow imbalance. Social sentiment for 1-hour+ horizon only.                                     |
| **Hybrid AMM + Orderbook Engine** | AMM depth combined with peer-to-peer precision execution. On-chain orderbook on Solana uses Drift Protocol-compatible architecture.                      |
| **Intent-Based Trading**          | Users specify desired outcomes in plain language — competitive solver network executes optimally (CoW Protocol / UniswapX architecture).                 |
| **Cross-Chain Smart Routing**     | Evaluates 50+ sources across 10+ chains simultaneously per trade. Sub-500ms quote aggregation via dedicated infrastructure nodes.                        |
| **Bridge-Abstracted Swaps**       | Assets appear to settle natively using intent solvers. Underlying bridge mechanism disclosed in UI — users are never misled.                             |
| **Smart Execution Splitting**     | Large orders split across time, pools, and chains using TWAP and VWAP algorithms to minimize market impact.                                              |
| **Multi-Layer MEV Protection**    | Private mempools (Flashbots Protect, MEV Blocker, ONEx private relay) + commitment schemes where users encrypt transaction parameters before submission. |
| **RL-Optimized Dynamic Fees**     | Fee curves recalibrated by a Reinforcement Learning agent. Updated weekly via governance-approved model upgrade. Outperforms static fee rules.           |
| **Gasless Trading Mode**          | Meta-transaction relayers (EIP-2771) cover gas costs on supported EVM chains. Funded by 0.005% gasless transaction surcharge. Not applicable to Solana.  |
