Tutorials
Tutorials
Step-by-step guides for building with LX - from your first trade to production deployment
LX Tutorials
Welcome to the LX tutorial series. These guides take you from beginner to production-ready, covering everything from placing your first trade to building sophisticated trading systems.
Learning Path
Follow this recommended progression to build your skills systematically:
LEARNING PATH
|
+--------------+--------------+
| |
[Beginner] [Intermediate]
| |
1. First Trade 5. Orderbook Sync
2. Authentication 6. Streaming Data
3. Testing 7. Market Maker Bot
| |
+--------------+--------------+
|
[Advanced]
|
8. Arbitrage Strategies
9. Production Deployment
10. Exchange MigrationBeginner Tutorials
Start here if you are new to LX.
| Tutorial | Duration | What You Will Learn |
|---|---|---|
| Your First Trade | 15 min | Place orders, check fills, understand basics |
| Authentication Setup | 10 min | API keys, JWT tokens, secure connections |
| Testing on Testnet | 20 min | Safe environment for development |
Intermediate Tutorials
Build on the basics with real-time data and automation.
| Tutorial | Duration | What You Will Learn |
|---|---|---|
| Orderbook Synchronization | 30 min | Keep local orderbook in sync with exchange |
| Real-time Streaming | 25 min | WebSocket feeds, event handling |
| Market Maker Bot | 45 min | Build a basic market making strategy |
Advanced Tutorials
Production-grade systems and professional strategies.
| Tutorial | Duration | What You Will Learn |
|---|---|---|
| Arbitrage Strategies | 40 min | Cross-market and triangular arbitrage |
| Production Checklist | 30 min | Deploy with confidence |
| Migration Guide | 35 min | Move from other exchanges |
Prerequisites
Before starting these tutorials, ensure you have:
Development Environment
# Required
node --version # v18.0.0 or higher
python --version # 3.10 or higher
go version # 1.21 or higher
# Optional (for advanced tutorials)
docker --version # 24.0 or higherLX Node Running
# Clone the repository
git clone https://github.com/luxfi/dex
cd dex
# Build and run
make build
./bin/lxd --testnetSDK Installation
Choose your preferred language:
# TypeScript/JavaScript
npm install @luxfi/trading
# Python
pip install lux-dex
# Go
go get github.com/luxfi/dex/sdk/goTutorial Format
Each tutorial follows a consistent structure:
- Objectives - What you will accomplish
- Prerequisites - What you need before starting
- Step-by-step Instructions - Detailed walkthrough
- Complete Code Examples - Working code in all supported languages
- Expected Output - What success looks like
- Common Pitfalls - Mistakes to avoid
- Next Steps - Where to go from here
Code Examples
All tutorials include complete, working code examples in:
- TypeScript - Web and Node.js applications
- Python - Data analysis and algorithmic trading
- Go - High-performance server applications
- cURL - Command-line testing
Support
If you get stuck:
- Check the FAQ for common issues
- Review the API Reference for detailed specifications
- Join our Discord for community help
- Open an issue on GitHub
Quick Reference
Endpoints
| Environment | JSON-RPC | WebSocket | gRPC |
|---|---|---|---|
| Testnet | http://localhost:8080/rpc | ws://localhost:8081 | localhost:50051 |
| Mainnet | https://api.lux.network/rpc | wss://api.lux.network/ws | grpc.lux.network:443 |
Common Operations
import { DEX } from '@luxfi/trading'
// Quick reference - TypeScript
const dex = await DEX({ rpcUrl: 'http://localhost:8080/rpc' })
// Place order
await dex.limitBuy('BTC-USD', '0.1', '50000')
// Cancel order
await dex.cancelOrder(orderId)
// Get orderbook
const book = await dex.getOrderBook('BTC-USD', 20)Ready to start? Begin with Your First Trade.