Files
dex/ext/hummingbot/connector/exchange/lx_dex/README.md
zeekay 9a97d82e99 fix(sdk/cpp): resolve integer overflow in AggregatedOrderbook best venue methods
The best_venue_buy() and best_venue_sell() methods used Decimal::from_double(1e18)
as a sentinel value, which caused integer overflow (1e18 * 1e8 scale = 1e26 exceeds
int64_t max ~9.2e18). This resulted in undefined behavior during price comparisons.

Changed to use std::optional<Decimal> for safe sentinel-free comparisons.
2025-12-11 22:27:56 -08:00

2.9 KiB

LX DEX Hummingbot Connectors

Official Hummingbot connectors for LX DEX.

Connectors

1. LX DEX Spot (lx_dex)

Central Limit Order Book (CLOB) connector for spot trading.

Features:

  • Limit and market orders
  • Real-time order book streaming
  • Order management (place, cancel, track)
  • Balance tracking

Usage:

>>> connect lx_dex
>>> create --strategy pure_market_making --exchange lx_dex --market LUX-USDC
>>> start

2. LX AMM (lx_amm)

Automated Market Maker connector for liquidity pool operations.

Features:

  • Token swaps via AMM pools
  • Add/remove liquidity
  • LP position tracking
  • Real-time price quotes

Usage:

>>> connect lx_amm
>>> create --strategy amm_arb --connector lx_amm --market LUX-USDC
>>> start

Configuration

API Keys

  1. Generate API keys at dex.lux.network
  2. Connect in Hummingbot:
>>> connect lx_dex
Enter your LX DEX API key: ***
Enter your LX DEX API secret: ***
Enter your wallet address: 0x...

Networks

Network Description
mainnet Production network
testnet Test network (free tokens via faucet)

Strategies

Pure Market Making (CLOB)

strategy: pure_market_making
exchange: lx_dex
market: LUX-USDC
bid_spread: 0.5%
ask_spread: 0.5%
order_amount: 100

AMM Arbitrage

strategy: amm_arb
connector_1: lx_amm
market_1: LUX-USDC
connector_2: binance
market_2: LUX-USDC
min_profitability: 0.5%

Cross-Exchange Market Making

strategy: cross_exchange_market_making
maker_exchange: lx_dex
taker_exchange: binance
market: LUX-USDC
min_profitability: 0.2%

Installation

From Source

# Clone Hummingbot
git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot

# Copy LX connectors
cp -r /path/to/lx/dex/hummingbot/connector/exchange/lx_dex hummingbot/connector/exchange/
cp -r /path/to/lx/dex/hummingbot/connector/gateway/amm/lx_amm hummingbot/connector/gateway/amm/

# Install
./install

With Gateway (for AMM)

# Start Gateway
cd gateway
npm install
npm run start

# Configure Gateway for LX
# Add to conf/lxdex.yml

API Reference

Spot Connector Methods

Method Description
buy() Place buy order
sell() Place sell order
cancel() Cancel order
get_balance() Get wallet balance
get_order_book() Get order book snapshot

AMM Connector Methods

Method Description
buy() Execute buy swap
sell() Execute sell swap
get_quote_price() Get swap quote
get_pool_info() Get pool reserves
add_liquidity() Add LP position
remove_liquidity() Remove LP position
get_lp_positions() Get LP positions