> ## Documentation Index
> Fetch the complete documentation index at: https://scalex.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

<img src="https://mintcdn.com/scalex/mNDh7pw-aJbddSLi/images/architecture.png?fit=max&auto=format&n=mNDh7pw-aJbddSLi&q=85&s=ca62d76eae59c23c3e6f2732fae08d5b" alt="Unified CLOB DEX-Lending Protocol Architecture" width="2000" height="940" data-path="images/architecture.png" />

The ScaleX AI trading assistant is built on a unified CLOB DEX-Lending Protocol, eight core components that work together to maximize capital efficiency and enable autonomous agent-driven trading.

## Core Components

The protocol operates through eight integrated components:

1. **[Balance Manager](./balance-manager)** - Maintains 1:1 peg, tracks yields, and issues synthetic tokens when users deposit assets

2. **[Synthetic Tokens](./synthetic-token)** - ERC20 tokens representing 1:1 pegged underlying assets that trade on the order book while users earn yield from underlying deposits

3. **[Order Book](./orderbook)** - High-performance CLOB with Red-Black Tree data structure for O(log n) price operations and integrated lending awareness

4. **[Oracle](./oracle)** - Multi-timeframe TWAP oracle providing manipulation-resistant pricing for trading, borrowing, and collateral valuation

5. **[Lending Manager](./lending-manager)** - Generates yield from real assets through native lending protocol with integrated order book access

6. **[Agent](./agent)** - AI trading assistant layer, on-chain agents that autonomously trade, borrow, and earn yield on behalf of users within policy-defined limits

7. **[ERC-8004](./erc8004)** - On-chain identity standard that gives every agent a verifiable NFT identity, enabling accountability, reputation, and cross-protocol interoperability

8. **[x402](./x402)** - Pay-per-use payment gate that allows agents to monetize their trading strategies per trade, per session, or by subscription
