Files
gate_scout_order/gate_order_executor
2026-05-16 22:25:48 +08:00
..
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00
2026-05-16 22:25:48 +08:00

gate_order_executor

仓库总览与 Git 克隆见上级目录:../README.md../CLONE.md

onchain_scout_gateMATRIX 扫描)并列的独立服务:接收结构化信号;在 gate.dry_run: false 且配置 API 密钥时,向 Gate USDT 永续发 市价开仓 + 计划止盈/止损(详见 使用说明.md §3.4.1)。扫描进程继续只用公共 API;本服务持有 API Key(仅本机 config.yaml)。

文档索引

文档 内容
docs/使用说明.md 职责、配置项、面板、接口、与扫描协作
docs/部署说明.md Ubuntu 安装、PM2、systemd、防火墙、同机部署
deploy/README.md deploy/ 下各脚本与 service 文件说明

目录位置(示例)

  • 山寨币扫描/onchain_scout_gate/ — 监控 + 企业微信
  • 山寨币扫描/gate_order_executor/ — 本下单执行器

本地快速运行

cd gate_order_executor
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp config.example.yaml config.yaml
# 编辑 config.yaml
python run.py
  • 健康检查:GET http://127.0.0.1:8090/health
  • 面板:http://127.0.0.1:8090/dashboard用资源管理器直接打开 templates/*.html,否则为白底无样式;须先 python run.py)。详见 使用说明.md

生产部署(PM2

chmod +x deploy/*.sh
bash deploy/bootstrap.sh /root/gate_order_executor
# 编辑 config.yaml 后:
bash deploy/pm2-start.sh

详见 docs/部署说明.md

信号接口(摘要)

POST /v1/signal,请求头 X-Webhook-Secretconfig.yamlsecurity.webhook_secret 一致。JSON 字段:signal_idcontract(如 BTC_USDT)、sidelong/short)、take_profitstop_loss(方案 A),可选 reference_price

gate.dry_run: true 时只记日志、不下单;false 且填写 api_key / api_secret 时走实盘(务必子账户、IP 白名单、先在小额上验证)。完整说明见 使用说明.md

curl -sS -X POST http://127.0.0.1:8090/v1/signal \
  -H "Content-Type: application/json" \
  -H "X-Webhook-Secret: your-secret" \
  -d '{"signal_id":"demo-1","contract":"BTC_USDT","side":"long","take_profit":99000,"stop_loss":97000}'

代理与 SOCKS

proxy 配置与扫描项目一致;SOCKS 需安装 socksio。详见 使用说明.md §3.6。