mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
docs: add LP specification references and implementation status
- Add LP specification links to all documentation pages - Add implementation status tables with GitHub source links - Add links to LP discussions on luxfi/LPs - Update architecture diagram with B-Chain sidecar model - Add redirect from / to /docs - Update API, SDK, orderbook, consensus, bridge, lending docs - Link to LP-9000 DEX series, LP-6000 Bridge series, LP-8401 Lending
This commit is contained in:
+2
-23
@@ -1,26 +1,5 @@
|
||||
import Link from "next/link"
|
||||
import { redirect } from 'next/navigation'
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<main className="flex flex-1 flex-col items-center justify-center px-4">
|
||||
<div className="container flex flex-col items-center gap-12 py-24 sm:gap-16 sm:py-32">
|
||||
<div className="flex flex-col items-center gap-4 text-center">
|
||||
<h1 className="text-4xl font-bold tracking-tight sm:text-6xl">
|
||||
Documentation
|
||||
</h1>
|
||||
<p className="max-w-2xl text-lg text-muted-foreground">
|
||||
Get started with our comprehensive documentation
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex gap-4">
|
||||
<Link
|
||||
href="/docs"
|
||||
className="inline-flex h-10 items-center justify-center rounded-md bg-primary px-8 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90"
|
||||
>
|
||||
Get Started
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
redirect('/docs')
|
||||
}
|
||||
|
||||
@@ -5,13 +5,25 @@ description: Complete API documentation for LX DEX - WebSocket, REST, and gRPC A
|
||||
|
||||
# LX DEX API Documentation
|
||||
|
||||
> **Specification**: [LP-9002 DEX API & RPC](https://github.com/luxfi/LPs/blob/main/LPs/lp-9002-dex-api-rpc-specification.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
|
||||
## Overview
|
||||
|
||||
LX DEX provides multiple API protocols for integration:
|
||||
- **WebSocket API** - Real-time market data and trading
|
||||
- **REST API** - Standard HTTP endpoints
|
||||
- **gRPC API** - High-performance binary protocol
|
||||
- **JSON-RPC 2.0** - Standard RPC interface
|
||||
- **JSON-RPC 2.0** - Primary RPC interface (`dex.*` namespace)
|
||||
- **gRPC** - High-performance binary protocol (port 9760)
|
||||
- **WebSocket** - Real-time push feeds
|
||||
- **REST** - Standard HTTP endpoints
|
||||
- **FIX** - Financial Information eXchange (institutional)
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| Component | Source | Status |
|
||||
|-----------|--------|--------|
|
||||
| JSON-RPC API | [`pkg/api/jsonrpc.go`](https://github.com/luxfi/dex/blob/main/pkg/api/jsonrpc.go) | Complete |
|
||||
| WebSocket Server | [`pkg/api/websocket_server.go`](https://github.com/luxfi/dex/blob/main/pkg/api/websocket_server.go) | Complete |
|
||||
| Trader Client | [`pkg/client/trader_client.go`](https://github.com/luxfi/dex/blob/main/pkg/client/trader_client.go) | Complete |
|
||||
| gRPC Protocol | [`pkg/grpc/pb/`](https://github.com/luxfi/dex/tree/main/pkg/grpc/pb) | Complete |
|
||||
|
||||
## WebSocket API
|
||||
|
||||
|
||||
@@ -5,42 +5,56 @@ description: LX DEX system architecture - multi-layer design for planet-scale pe
|
||||
|
||||
# LX DEX Architecture
|
||||
|
||||
> **Specification**: [LP-9001 DEX Trading Engine](https://github.com/luxfi/LPs/blob/main/LPs/lp-9001-dex-trading-engine.md) | [LP-9003 High-Performance DEX](https://github.com/luxfi/LPs/blob/main/LPs/lp-9003-high-performance-dex-protocol.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
|
||||
## Overview
|
||||
|
||||
The LX DEX is built on a highly scalable, modular architecture designed to achieve planet-scale performance with sub-microsecond latency. The system uses a multi-layer approach with specialized components for different aspects of trading.
|
||||
The LX DEX is built on a highly scalable, modular architecture designed to achieve planet-scale performance with sub-microsecond latency. The DEX runs as a **standalone sidecar daemon** (`lxd`) separate from the Lux blockchain node, communicating via Warp messages for settlement. This architecture enables sub-millisecond order matching while maintaining blockchain settlement guarantees.
|
||||
|
||||
## System Architecture
|
||||
|
||||
```
|
||||
+------------------------------------------------------------+
|
||||
| Client Layer |
|
||||
| Web UI | Mobile | API Clients | Trading Bots | SDKs |
|
||||
+----------------------------+-------------------------------+
|
||||
|
|
||||
+----------------------------v-------------------------------+
|
||||
| Gateway Layer |
|
||||
| Load Balancer | Rate Limiter | Auth | WebSocket/gRPC |
|
||||
+----------------------------+-------------------------------+
|
||||
|
|
||||
+----------------------------v-------------------------------+
|
||||
| Application Layer |
|
||||
| Order Management | Risk Engine | Market Data | Admin |
|
||||
+----------------------------+-------------------------------+
|
||||
|
|
||||
+----------------------------v-------------------------------+
|
||||
| Core Engine Layer |
|
||||
| Matching Engine | Clearing | Settlement | Liquidation |
|
||||
+----------------------------+-------------------------------+
|
||||
|
|
||||
+----------------------------v-------------------------------+
|
||||
| Consensus Layer |
|
||||
| DAG Consensus | Validator Network | State Machine |
|
||||
+----------------------------+-------------------------------+
|
||||
|
|
||||
+----------------------------v-------------------------------+
|
||||
| Storage Layer |
|
||||
| Order DB | Trade History | State DB | Archive |
|
||||
+------------------------------------------------------------+
|
||||
┌──────────────────────────────────────────────────────────────────────┐
|
||||
│ DEX SIDECAR NETWORK │
|
||||
│ (Standalone from Lux Node) │
|
||||
├──────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ lxd (DEX Daemon) │ │
|
||||
│ │ ┌────────────────────────────────────────────────────────────┐ │ │
|
||||
│ │ │ TRADING ENGINE │ │ │
|
||||
│ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │
|
||||
│ │ │ │ ORDERBOOK BACKENDS │ │ │ │
|
||||
│ │ │ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │ │ │
|
||||
│ │ │ │ │ Pure Go │ │ CGO/C++ │ │ GPU │ │ FPGA │ │ │ │ │
|
||||
│ │ │ │ │ 1M/sec │ │ 500K/s │ │ 1.6M/s │ │ 100M/s │ │ │ │ │
|
||||
│ │ │ │ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │ │ │ │
|
||||
│ │ │ └──────────────────────────────────────────────────────┘ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │
|
||||
│ │ │ │ MATCHING LOGIC │ │ │ │
|
||||
│ │ │ │ • Price-Time Priority (FIFO) │ │ │ │
|
||||
│ │ │ │ • Pro-Rata Mode (Configurable) │ │ │ │
|
||||
│ │ │ │ • TWAP/VWAP Execution │ │ │ │
|
||||
│ │ │ │ • Iceberg/Hidden Orders │ │ │ │
|
||||
│ │ │ └──────────────────────────────────────────────────────┘ │ │ │
|
||||
│ │ └────────────────────────────────────────────────────────────┘ │ │
|
||||
│ │ │ │
|
||||
│ │ ┌────────────────────────────────────────────────────────────┐ │ │
|
||||
│ │ │ DAG CONSENSUS │ │ │
|
||||
│ │ │ • Order Sequencing │ │ │
|
||||
│ │ │ • Trade Finality: 50ms │ │ │
|
||||
│ │ │ • Parallel Vertex Processing │ │ │
|
||||
│ │ └────────────────────────────────────────────────────────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────────────────┘ │
|
||||
│ │ │
|
||||
│ Warp Messages │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ Lux Blockchain Node │ │
|
||||
│ │ (C-Chain for EVM, B-Chain for Bridge, etc.) │ │
|
||||
│ └─────────────────────────────────────────────────────────────────┘ │
|
||||
└──────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Core Components
|
||||
|
||||
@@ -5,8 +5,22 @@ description: Universal asset bridge for cross-chain transfers between major bloc
|
||||
|
||||
# Cross-Chain Bridge
|
||||
|
||||
> **Specification**: [LP-6000 B-Chain Bridge](https://github.com/luxfi/LPs/blob/main/LPs/lp-6000-b-chain-bridge-specification.md) | [LP-6015 MPC Bridge Protocol](https://github.com/luxfi/LPs/blob/main/LPs/lp-6015-mpc-bridge-protocol.md) | [LP-6016 Teleport Protocol](https://github.com/luxfi/LPs/blob/main/LPs/lp-6016-teleport-cross-chain-protocol.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
>
|
||||
> **Implementation**: [`github.com/luxfi/bridge`](https://github.com/luxfi/bridge) | [`vms/bridgevm`](https://github.com/luxfi/node/tree/main/vms/bridgevm)
|
||||
|
||||
The LX DEX bridge enables seamless asset transfers between multiple blockchains.
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| Component | Source | Status |
|
||||
|-----------|--------|--------|
|
||||
| BridgeVM (B-Chain) | [`vms/bridgevm/`](https://github.com/luxfi/node/tree/main/vms/bridgevm) | Complete |
|
||||
| MPC Custody | [`vms/bridgevm/custody/`](https://github.com/luxfi/node/tree/main/vms/bridgevm/custody) | Complete |
|
||||
| Threshold Signing | [`github.com/luxfi/threshold`](https://github.com/luxfi/threshold) | Complete |
|
||||
| Bridge Contracts | [`github.com/luxfi/standard`](https://github.com/luxfi/standard) | Complete |
|
||||
| Bridge UI | [`bridge/app/bridge-ui/`](https://github.com/luxfi/bridge/tree/main/app/bridge-ui) | Complete |
|
||||
|
||||
## Overview
|
||||
|
||||
The bridge supports:
|
||||
@@ -29,6 +43,30 @@ The bridge supports:
|
||||
| Solana | Beta | SOL, SPL tokens |
|
||||
| Cosmos | Beta | ATOM, IBC tokens |
|
||||
|
||||
## Bridge Architecture
|
||||
|
||||
The B-Chain (Bridge Chain) is a dedicated blockchain for cross-chain operations, implementing MPC-based custody using CGGMP21 threshold signatures extended with Ringtail for quantum safety.
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ B-Chain Architecture │
|
||||
├─────────────────────────────┬───────────────────────────────────┤
|
||||
│ External Chains │ B-Chain Core │
|
||||
├─────────────────────────────┼───────────────────────────────────┤
|
||||
│ • Ethereum │ • MPC Custody (CGGMP21) │
|
||||
│ • Bitcoin │ • Ringtail Quantum Extension │
|
||||
│ • BSC │ • Asset Registry │
|
||||
│ • Polygon │ • Threshold Signing │
|
||||
│ • Arbitrum │ • Bridge State Machine │
|
||||
│ • Cosmos │ • Slashing & Rewards │
|
||||
└─────────────────────────────┴───────────────────────────────────┘
|
||||
│
|
||||
┌─────────────┴─────────────┐
|
||||
│ Lux Internal Chains │
|
||||
│ (P, C, X, Q, A, T, Z) │
|
||||
└───────────────────────────┘
|
||||
```
|
||||
|
||||
## Bridge Flow
|
||||
|
||||
```
|
||||
|
||||
@@ -5,8 +5,21 @@ description: DAG-based consensus with 1ms finality and quantum-resistant signatu
|
||||
|
||||
# Consensus Layer
|
||||
|
||||
> **Specification**: [LP-0111 Photon Consensus](https://github.com/luxfi/LPs/blob/main/LPs/lp-0111-photon-consensus-selection.md) | [LP-0112 Flare DAG](https://github.com/luxfi/LPs/blob/main/LPs/lp-0112-flare-dag-finalization-protocol.md) | [LP-4099 Quasar](https://github.com/luxfi/LPs/blob/main/LPs/lp-4099-q-chain-quantum-secure-consensus-protocol-family-quasar.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
>
|
||||
> **Implementation**: [`github.com/luxfi/consensus`](https://github.com/luxfi/consensus)
|
||||
|
||||
LX DEX uses a custom DAG-based consensus protocol designed for ultra-low latency trading.
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| Component | Source | Status |
|
||||
|-----------|--------|--------|
|
||||
| DAG Consensus | [`consensus/engine/dag/`](https://github.com/luxfi/consensus/tree/main/engine/dag) | Complete |
|
||||
| FPC Protocol | [`consensus/protocol/photon/`](https://github.com/luxfi/consensus/tree/main/protocol/photon) | Complete |
|
||||
| Flare Finalization | [`consensus/protocol/flare/`](https://github.com/luxfi/consensus/tree/main/protocol/flare) | Complete |
|
||||
| Quasar (PQ) | [`consensus/protocol/quasar/`](https://github.com/luxfi/consensus/tree/main/protocol/quasar) | Complete |
|
||||
|
||||
## Overview
|
||||
|
||||
The consensus layer provides:
|
||||
|
||||
@@ -5,6 +5,10 @@ description: Build, test, and contribute to LX DEX
|
||||
|
||||
# LX DEX Development Guide
|
||||
|
||||
> **Specification**: [LP-0050 Developer Tools Overview](https://github.com/luxfi/LPs/blob/main/LPs/lp-0050-developer-tools-overview.md) | [LP-0006 Network Runner and Testing Framework](https://github.com/luxfi/LPs/blob/main/LPs/lp-0006-network-runner-and-testing-framework.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
>
|
||||
> **Implementation**: [`github.com/luxfi/dex`](https://github.com/luxfi/dex)
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
@@ -5,6 +5,10 @@ description: Quick start guide for LX DEX - installation, setup, and your first
|
||||
|
||||
# Getting Started with LX DEX
|
||||
|
||||
> **Specification**: [LP-9000 DEX Core](https://github.com/luxfi/LPs/blob/main/LPs/lp-9000-dex-core-specification.md) | [LP-9002 DEX API](https://github.com/luxfi/LPs/blob/main/LPs/lp-9002-dex-api-rpc-specification.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
>
|
||||
> **Implementation**: [`github.com/luxfi/dex`](https://github.com/luxfi/dex)
|
||||
|
||||
Get up and running with LX DEX in minutes.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -7,9 +7,11 @@ description: Ultra-High Performance Decentralized Exchange - 434M+ orders/sec wi
|
||||
|
||||
Ultra-high performance DEX with **434M+ orders/sec** on Apple Silicon.
|
||||
|
||||
> **LP Specifications**: This implementation follows [LP-9000 DEX Series](https://github.com/luxfi/LPs/tree/main/LPs) - see [LP-9000](https://github.com/luxfi/LPs/blob/main/LPs/lp-9000-dex-core-specification.md), [LP-9001](https://github.com/luxfi/LPs/blob/main/LPs/lp-9001-dex-trading-engine.md), [LP-9002](https://github.com/luxfi/LPs/blob/main/LPs/lp-9002-dex-api-rpc-specification.md), [LP-9003](https://github.com/luxfi/LPs/blob/main/LPs/lp-9003-high-performance-dex-protocol.md)
|
||||
|
||||
## Overview
|
||||
|
||||
LX DEX is a planet-scale, fully on-chain decentralized exchange built on Lux Network, combining ultra-low latency matching, quantum-resistant security, and support for global markets in a unified system.
|
||||
LX DEX is a planet-scale, fully on-chain decentralized exchange built on Lux Network, combining ultra-low latency matching, quantum-resistant security, and support for global markets in a unified system. The DEX runs as a **standalone sidecar daemon** (`lxd`) separate from the Lux blockchain node, communicating via Warp messages for settlement.
|
||||
|
||||
## Key Performance
|
||||
|
||||
|
||||
@@ -5,8 +5,22 @@ description: Decentralized lending and borrowing with margin trading support
|
||||
|
||||
# Lending Protocol
|
||||
|
||||
> **Specification**: [LP-8401 Confidential Lending Protocol](https://github.com/luxfi/LPs/blob/main/LPs/lp-8401-confidential-lending-protocol.md) | [LP-9060 DeFi Protocols Overview](https://github.com/luxfi/LPs/blob/main/LPs/lp-9060-defi-protocols-overview.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
>
|
||||
> **Implementation**: [`github.com/luxfi/standard/src/lending`](https://github.com/luxfi/standard/tree/main/src/lending)
|
||||
|
||||
LX DEX includes a decentralized lending protocol for margin trading and yield generation.
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| Component | Source | Status |
|
||||
|-----------|--------|--------|
|
||||
| Lending Core | [`standard/src/lending/`](https://github.com/luxfi/standard/tree/main/src/lending) | Complete |
|
||||
| ZK Credit Scoring | [`standard/src/lending/credit/`](https://github.com/luxfi/standard/tree/main/src/lending/credit) | Complete |
|
||||
| Collateral Management | [`standard/src/lending/collateral/`](https://github.com/luxfi/standard/tree/main/src/lending/collateral) | Complete |
|
||||
| Liquidation Engine | [`standard/src/lending/liquidation/`](https://github.com/luxfi/standard/tree/main/src/lending/liquidation) | Complete |
|
||||
| Flash Loans | [`standard/src/lending/flash/`](https://github.com/luxfi/standard/tree/main/src/lending/flash) | Complete |
|
||||
|
||||
## Overview
|
||||
|
||||
The lending protocol enables:
|
||||
|
||||
@@ -5,8 +5,21 @@ description: High-performance order matching engine - 434M+ orders/sec with sub-
|
||||
|
||||
# Orderbook Engine
|
||||
|
||||
> **Specification**: [LP-9001 DEX Trading Engine](https://github.com/luxfi/LPs/blob/main/LPs/lp-9001-dex-trading-engine.md) | [LP-9003 High-Performance DEX](https://github.com/luxfi/LPs/blob/main/LPs/lp-9003-high-performance-dex-protocol.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
|
||||
The LX DEX orderbook engine is designed for ultra-high performance trading with multiple backend options.
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| Component | Source | Status |
|
||||
|-----------|--------|--------|
|
||||
| Order Book | [`pkg/lx/orderbook.go`](https://github.com/luxfi/dex/blob/main/pkg/lx/orderbook.go) | Complete |
|
||||
| Advanced Orderbook | [`pkg/lx/orderbook_advanced.go`](https://github.com/luxfi/dex/blob/main/pkg/lx/orderbook_advanced.go) | Complete |
|
||||
| Matching Engine | [`pkg/lx/orderbook_extended.go`](https://github.com/luxfi/dex/blob/main/pkg/lx/orderbook_extended.go) | Complete |
|
||||
| C++ Engine | [`pkg/orderbook/cpp_orderbook.go`](https://github.com/luxfi/dex/blob/main/pkg/orderbook/cpp_orderbook.go) | Complete |
|
||||
| GPU (MLX) | [`pkg/mlx/mlx.go`](https://github.com/luxfi/dex/blob/main/pkg/mlx/mlx.go) | Complete |
|
||||
| FPGA | [`pkg/fpga/fpga_engine.go`](https://github.com/luxfi/dex/blob/main/pkg/fpga/fpga_engine.go) | Complete |
|
||||
|
||||
## Overview
|
||||
|
||||
The matching engine achieves:
|
||||
|
||||
@@ -5,6 +5,8 @@ description: Client libraries for integrating with LX DEX - TypeScript, Python,
|
||||
|
||||
# LX DEX SDK Documentation
|
||||
|
||||
> **Specification**: [LP-9002 DEX API & RPC](https://github.com/luxfi/LPs/blob/main/LPs/lp-9002-dex-api-rpc-specification.md) | [Discussions](https://github.com/luxfi/LPs/discussions)
|
||||
|
||||
## Overview
|
||||
|
||||
LX DEX provides multiple SDKs and APIs for integration:
|
||||
@@ -13,6 +15,15 @@ LX DEX provides multiple SDKs and APIs for integration:
|
||||
- **Go** - High-performance server applications
|
||||
- **Rust** - Systems programming (coming soon)
|
||||
|
||||
## Implementation Status
|
||||
|
||||
| SDK | Repository | Status |
|
||||
|-----|------------|--------|
|
||||
| TypeScript | [`@luxfi/dex-sdk`](https://github.com/luxfi/dex/tree/main/sdk/typescript) | Complete |
|
||||
| Python | [`luxfi-dex`](https://github.com/luxfi/dex/tree/main/sdk/python) | Complete |
|
||||
| Go | [`github.com/luxfi/dex/sdk/go`](https://github.com/luxfi/dex/tree/main/sdk/go) | Complete |
|
||||
| Rust | [`luxfi-dex`](https://github.com/luxfi/dex/tree/main/sdk/rust) | In Progress |
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Start the DEX Node
|
||||
|
||||
Reference in New Issue
Block a user