A gRPC-based counterparty (CPTY) integration that enables Architect to trade on the Lighter exchange.
- ✅ Full order lifecycle support (place, cancel, track)
- ✅ 43 supported markets including ETH, BTC, HYPE, BERA, FARTCOIN, and more
- ✅ Real-time WebSocket updates for order status and fills
- ✅ Automatic symbol mapping between Architect and Lighter formats
- ✅ Market-specific decimal precision handling
- ✅ Async implementation for better performance and concurrency
- ✅ Cancel all orders support (both native and synthetic)
- ✅ Automatic balance monitoring and reporting
- Python 3.12+
- Lighter API credentials
# Create virtual environment
python3.12 -m venv lighter_env
source lighter_env/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file with your Lighter credentials:
LIGHTER_API_KEY_PRIVATE_KEY=your_private_key_here
LIGHTER_ACCOUNT_INDEX=30188
LIGHTER_API_KEY_INDEX=1
LIGHTER_URL=https://mainnet.zklighter.elliot.aipython -m LighterCpty.lighter_cpty_asyncThe async server will start on port 50051 and accept connections from Architect core.
The integration supports all 43 markets on Lighter mainnet:
| Symbol | Market ID | Symbol | Market ID |
|---|---|---|---|
| ETH | 0 | FARTCOIN | 21 |
| BTC | 1 | AI16Z | 22 |
| SOL | 2 | POPCAT | 23 |
| DOGE | 3 | HYPE | 24 |
| 1000PEPE | 4 | BNB | 25 |
| WIF | 5 | JUP | 26 |
| WLD | 6 | AAVE | 27 |
| XRP | 7 | MKR | 28 |
| LINK | 8 | ENA | 29 |
| AVAX | 9 | UNI | 30 |
| NEAR | 10 | APT | 31 |
| DOT | 11 | SEI | 32 |
| TON | 12 | KAITO | 33 |
| TAO | 13 | IP | 34 |
| POL | 14 | LTC | 35 |
| TRUMP | 15 | CRV | 36 |
| SUI | 16 | PENDLE | 37 |
| 1000SHIB | 17 | ONDO | 38 |
| 1000BONK | 18 | ADA | 39 |
| 1000FLOKI | 19 | S | 40 |
| BERA | 20 | VIRTUAL | 41 |
| SPX | 42 |
Architect uses a standardized symbol format:
BASE-QUOTE LIGHTER Perpetual/QUOTE Crypto
Examples:
ETH-USDC LIGHTER Perpetual/USDC CryptoHYPE-USDC LIGHTER Perpetual/USDC CryptoBERA-USDC LIGHTER Perpetual/USDC Crypto
lighter_cpty/
├── LighterCpty/
│ ├── __init__.py
│ ├── lighter_cpty_async.py # Async CPTY implementation (main)
│ ├── lighter_cpty.py # Legacy sync implementation
│ ├── balance_fetcher.py # Balance monitoring
│ ├── config_loader.py # Configuration management
│ └── grpc_server_patch.py # gRPC server utilities
├── requirements.txt # Python dependencies
├── .env # Configuration (not in git)
├── docs/ # Documentation
├── examples/ # Example scripts
└── tests/ # Test files
See the examples/ directory for sample order placement scripts:
# Place a HYPE order
python examples/fartcoin_order_simple.pyMIT License