mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Decentralized exchange; the engine acts like an order book but is decentralized, so 'Central Limit Order Book' is a misnomer. Branded/service surface → DEX (RegisterDEX, DEXMethod*, dex_* wire). Matching engine + GPU → OrderBook (OrderBookMatch/Source/Arena, source_orderbook.go), preserving the AMM-vs-orderbook distinction. C-ABI → dex_orderbook_* (matches luxcpp). SDKs/clients/docs aligned. CGO=0 + cgo builds clean; full suite 23 pkgs green (dchain/dex/lx/fix/gateway/zapwire). Legit financial-term 'Central Limit Order Book' retained in hummingbot taxonomy.
2.2 KiB
2.2 KiB
LX Hummingbot Gateway Plugin
Official Hummingbot Gateway plugin for LX.
Installation
Via npm
npm install hummingbot-gateway-lxdex-plugin
Manual Installation
- Clone the repository:
git clone https://github.com/luxfi/dex.git
cd dex/hummingbot-gateway/plugins/lxdex
- Install dependencies and build:
npm install
npm run build
- Link to your Gateway installation:
npm link
cd /path/to/hummingbot-gateway
npm link hummingbot-gateway-lxdex-plugin
Configuration
Copy the configuration file to your Gateway config directory:
cp config/lxdex.yml /path/to/hummingbot-gateway/conf/
Configuration Options
Edit conf/lxdex.yml to customize:
- Network endpoints: API, WebSocket, gRPC URLs
- Trading parameters: Slippage, max hops, quote expiration
- Gas settings: Gas limit, price source
- Rate limits: Requests per second
- WebSocket: Auto-reconnect, ping intervals
Usage
Register with Gateway
In your Gateway startup file:
import { FastifyInstance } from 'fastify';
import { lxdexPlugin } from 'hummingbot-gateway-lxdex-plugin';
async function start(fastify: FastifyInstance) {
// Register LX plugin
await fastify.register(lxdexPlugin);
await fastify.listen({ port: 15888 });
}
Test Endpoints
# Health check
curl http://localhost:15888/lxdex/health
# Get swap quote
curl "http://localhost:15888/lxdex/router/quote-swap?baseToken=LUX"eToken=USDC&amount=1000000000000000000&side=SELL"
# Get trading pairs
curl http://localhost:15888/lxdex/pairs
Supported Trading Operations
| Schema | Endpoint Prefix | Operations |
|---|---|---|
| Router | /lxdex/router |
Quote swap, Execute swap |
| AMM | /lxdex/amm |
Pool info, Add/Remove liquidity |
| CLMM | /lxdex/clmm |
Open/Close positions, Collect fees |
| OrderBook | /lxdex |
Place/Cancel orders, Order book |
Links
License
Apache-2.0