Skip to main content

Module crypto_exchange

Module crypto_exchange 

Source
Expand description

CMD 18012 kCmdGetLv2RelatedExchange — 数字货币 LV2 摆盘关联交易所查询.

对齐 C++:

  • NNProtoCenter/Quote/NNBiz_Qot_CryptoExchange.cpp:24-51 GetLv2RelatedExchange(): 构造 FTMdfRelatedSvr::GetLv2RelatedExchangeReq, 填 stock_id + 可选 broker_id_list, 走 NN_TCPProtoCategory_Quote 发 CMD 18012.
  • NNProtoCenter/Quote/NNBiz_Qot_CryptoExchange.cpp:82-154 OnReply_*: 遍历 pbRsp.exchange_list(), 用 UnpackExchangeInfo 解每条 ExchangeInfo, exchange_name == "PT"GetCryptoPTOrderBookQotRight() != NN_QotRight_CC_Level1 则过滤掉 (line 123-126).
  • NNProtoCenter/Quote/INNBiz_Qot_CryptoExchange.cpp:15-18: FTGateway/APIServer 通过 INNBiz_Qot_CryptoExchange::GetLv2RelatedExchange 触发, response 写入 INNData_Qot_CryptoExchange::SetLv2RelatedExchange 并触发 INNBiz_Qot_PushQot::ReSubCryptoOrderBook 重新订阅.

§v1.4.110 codex QOT Phase 4 Slice 7

之前 Rust 数字货币 LV2 摆盘只走普通 OrderBook bit=3 路径, 拿不到 multi-exchange 合并后的 40 档摆盘. 本模块补 CMD18012 caller, 给 GetOrderBookHandler / push parser 提供 stock→exchange 列表 + PT 过滤, 是 broker-aware crypto LV2 orderbook 完整 sub-system 的入口.

§Hardcoded / Assumption Ledger

  • CMD 18012 (NN_ProtoCmd_Qot_Pull_GetLv2RelatedExchange) 来源: /Users/leaf/ai-lab/o-src/FutuOpenD/Src/NNBase/NNBase_Define_ProtoCmd.h (在 18000 系列 quote-related cmd 范围). 已加入 is_unencrypted_proto 白名单 (nn_codec.rs::is_unencrypted_proto).
  • PT 过滤阈值 cc_pt_orderbook_qot_right == NN_QotRight_CC_Level1 (==2) 来源: NNBiz_Qot_CryptoExchange.cpp:123 INNData_Qot_Right::GetCryptoPTOrderBookQotRight() != NN_QotRight_CC_Level1. Rust cc_pt_orderbook_qot_right 即对应字段; constants 见 futu-cache::qot_right (QOT_RIGHT_LEVEL1 = 2).
  • exchange_name == "PT" 是 C++ #define CRYPTO_PTExchange _TStr("PT") 协议常量 (NNBiz_Qot_CryptoExchange.cpp:14). 不是服务端动态下发的列表名, Rust 复刻可接受.

Structs§

CryptoExchangeInfo
Re-export CryptoExchangeInfo from futu_cache — single source of truth.

Constants§

CMD_GET_LV2_RELATED_EXCHANGE
CMD 号 — 数字货币 LV2 关联交易所查询.
CRYPTO_PT_EXCHANGE_NAME
C++ #define CRYPTO_PTExchange _TStr("PT") (NNBiz_Qot_CryptoExchange.cpp:14). 当 cc_pt_orderbook_qot_right != QOT_RIGHT_LEVEL1 时, 跳过此 exchange_name 的 entry.

Functions§

get_lv2_related_exchange
发 CMD18012 GetLv2RelatedExchange, 解析 response 成 Vec<CryptoExchangeInfo>.