find-xemm-opps

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

find-xemm-opps

寻找XEMM机会

Find Cross-Exchange Market Making (XEMM) opportunities by analyzing order book depth and liquidity across connected exchanges.
XEMM involves quoting on one exchange (the maker side) while hedging fills on another (the taker/hedge side). The best opportunities exist where:
  • One exchange has a wide spread and thin book (maker side — room to quote profitably)
  • Another has a tight spread and deep book (taker side — cheap to hedge)
  • A mid-price difference exists between them
通过分析已连接交易所的订单簿深度和流动性,寻找跨交易所做市(XEMM)机会。
XEMM策略包括在一个交易所(maker方)报价,同时在另一个交易所(taker/对冲方)对冲成交订单。最佳机会出现在以下场景:
  • 某一交易所拥有宽点差薄订单簿(maker方——存在可盈利报价的空间)
  • 另一交易所拥有窄点差厚订单簿(taker方——对冲成本低廉)
  • 两者之间存在中间价差异

Prerequisites

前置条件

Hummingbot API must be running with exchange connectors configured:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/lp-agent/scripts/check_prerequisites.sh)
必须运行Hummingbot API并配置好交易所连接器:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/lp-agent/scripts/check_prerequisites.sh)

Workflow

工作流程

Step 1: Define Token Pair

步骤1:定义交易对

bash
undefined
bash
undefined

Scan for SOL/USDT XEMM opportunities

扫描SOL/USDT的XEMM机会

python scripts/find_xemm_opps.py --base SOL --quote USDT
python scripts/find_xemm_opps.py --base SOL --quote USDT

Include fungible equivalents

包含可替代等价代币

python scripts/find_xemm_opps.py --base ETH,WETH --quote USDT,USDC
python scripts/find_xemm_opps.py --base ETH,WETH --quote USDT,USDC

Filter to specific connectors

筛选特定交易所连接器

python scripts/find_xemm_opps.py --base BTC --quote USDT --connectors binance,kraken,coinbase,okx
python scripts/find_xemm_opps.py --base BTC --quote USDT --connectors binance,kraken,coinbase,okx

Minimum mid-price spread between exchanges (default: 0.0%)

交易所间最低中间价点差(默认:0.0%)

python scripts/find_xemm_opps.py --base SOL --quote USDC --min-spread 0.05
undefined
python scripts/find_xemm_opps.py --base SOL --quote USDC --min-spread 0.05
undefined

Step 2: Interpret Results

步骤2:解读结果

The script outputs a market overview table and ranked XEMM opportunity pairs:
====================================================================
  XEMM Opportunities — SOL / USDC
  Order book depth: 20 levels | Sources: 18
====================================================================

  Exchange               Pair            Mid     Spread    Bid Depth    Ask Depth    B/A
  ---------------------- -------------- ---------- -------- ------------ ------------ ------
  bitstamp               SOL-USDC         $87.45   0.120%       $23.4K       $18.9K   1.24
  binance                SOL-USDT         $87.51   0.015%      $412.0K      $389.0K   1.06
  okx                    SOL-USDT         $87.56   0.023%      $287.0K      $301.0K   0.95
  ...

  Top XEMM Opportunities (MAKER → hedge on TAKER):
  ----------------------------------------------------------------

  #1  Score: 8.42
      MAKER  bitstamp               $87.45  spread 0.120%  depth $42.3K
      TAKER  binance                $87.51  spread 0.015%  depth $801.0K
      Mid-price gap: 0.0686%  |  Spread ratio: 8.0x  |  Depth ratio: 18.9x
Columns explained:
ColumnDescription
MidMid-price between best bid and ask
SpreadBid-ask spread as % of mid
Bid/Ask DepthTotal quote value of top-N order book levels
B/ABid-to-ask depth ratio (>1 = more buy pressure)
Spread ratioMaker spread ÷ taker spread — higher = better maker edge
Depth ratioTaker depth ÷ maker depth — higher = better hedge liquidity
脚本会输出市场概览表格和排名靠前的XEMM机会交易对
====================================================================
  XEMM Opportunities — SOL / USDC
  Order book depth: 20 levels | Sources: 18
====================================================================

  Exchange               Pair            Mid     Spread    Bid Depth    Ask Depth    B/A
  ---------------------- -------------- ---------- -------- ------------ ------------ ------
  bitstamp               SOL-USDC         $87.45   0.120%       $23.4K       $18.9K   1.24
  binance                SOL-USDT         $87.51   0.015%      $412.0K      $389.0K   1.06
  okx                    SOL-USDT         $87.56   0.023%      $287.0K      $301.0K   0.95
  ...

  Top XEMM Opportunities (MAKER → hedge on TAKER):
  ----------------------------------------------------------------

  #1  Score: 8.42
      MAKER  bitstamp               $87.45  spread 0.120%  depth $42.3K
      TAKER  binance                $87.51  spread 0.015%  depth $801.0K
      Mid-price gap: 0.0686%  |  Spread ratio: 8.0x  |  Depth ratio: 18.9x
列说明:
列名描述
Mid最优买价和卖价之间的中间价
Spread买卖点差占中间价的百分比
Bid/Ask Depth前N档订单簿的总报价价值
B/A买盘深度与卖盘深度的比率(>1表示买盘压力更大)
Spread ratioMaker点差 ÷ Taker点差 —— 数值越高,Maker方优势越大
Depth ratioTaker深度 ÷ Maker深度 —— 数值越高,对冲流动性越好

Script Options

脚本选项

OptionDescription
--base
Base token(s), comma-separated (e.g., ETH,WETH)
--quote
Quote token(s), comma-separated (e.g., USDT,USDC)
--connectors
Filter to specific connectors (optional)
--depth
Order book depth per exchange (default: 20)
--min-spread
Minimum mid-price spread % between exchanges (default: 0.0)
--include-btc-markets
Include btc_markets (Australian residents only)
--include-ndax
Include ndax (Canadian residents only)
--json
Output as JSON
选项描述
--base
基础代币(可逗号分隔,例如:ETH,WETH)
--quote
报价代币(可逗号分隔,例如:USDT,USDC)
--connectors
筛选特定交易所连接器(可选)
--depth
每个交易所的订单簿深度(默认:20)
--min-spread
交易所间最低中间价点差百分比(默认:0.0)
--include-btc-markets
包含btc_markets(仅澳大利亚居民可用)
--include-ndax
包含ndax(仅加拿大居民可用)
--json
以JSON格式输出

Environment Variables

环境变量

bash
export HUMMINGBOT_API_URL=http://localhost:8000
export API_USER=admin
export API_PASS=admin
Scripts check for
.env
in:
./hummingbot-api/.env
~/.hummingbot/.env
.env
bash
export HUMMINGBOT_API_URL=http://localhost:8000
export API_USER=admin
export API_PASS=admin
脚本会在以下路径查找
.env
文件:
./hummingbot-api/.env
~/.hummingbot/.env
.env

Requirements

要求

  • Hummingbot API running
  • At least 2 exchange connectors configured with API keys
  • 运行中的Hummingbot API
  • 至少配置了2个带有API密钥的交易所连接器