Files
crypto_monitor/docs/auto-transfer-daily.md
dekun 67cc084347 fix(gate): align fund transfer between gate and gate_bot
- Extract shared gate_transfer_lib and global transfer form on all pages

- Block auto-transfer when trend pullback plans have open positions

- Redirect manual transfer back to the current page after submit

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 10:01:32 +08:00

46 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 每日自动划转(四所统一)
## 行为
`.env` 开启 `AUTO_TRANSFER_ENABLED=true` 后,监控轮询在**北京时间 `AUTO_TRANSFER_BJ_HOUR` 整点所在小时**内(默认 8:00–8:59)执行一次(按 **UTC 自然日** 去重):
| 交易账户 (`AUTO_TRANSFER_TO`,默认 swap) | 动作 |
|------------------------------------------|------|
| 余额 **低于** `AUTO_TRANSFER_AMOUNT` | 从 `AUTO_TRANSFER_FROM`(默认 funding)划入差额 |
| 余额 **高于** `AUTO_TRANSFER_AMOUNT` | 将多余划回 `AUTO_TRANSFER_FROM` |
| 与目标相差 &lt; 0.01U | 跳过,不写划转 |
| 存在 **active** 持仓(`order_monitors`,或 Gate 趋势回调已开仓计划) | **不划转**,写账簿 `skipped`,并**企业微信**说明「持仓中,本次资金无划转」 |
## 配置示例(目标 50U
```env
AUTO_TRANSFER_ENABLED=true
AUTO_TRANSFER_AMOUNT=50
AUTO_TRANSFER_FROM=funding
AUTO_TRANSFER_TO=swap
AUTO_TRANSFER_BJ_HOUR=8
```
`AUTO_TRANSFER_AMOUNT``DAILY_START_CAPITAL`(每日开仓基数)**独立**。
API Key 须具备万向划转权限(与手动划转相同)。
## 用脚本更新四所 `.env`
详见 **[env-sync-scripts.md](./env-sync-scripts.md)**。常用命令:
```bash
git pull
# 仅补全划转相关项
python scripts/sync_four_exchange_transfer_env.py
# 目标 50U 并开启自动划转
python scripts/sync_four_exchange_transfer_env.py --set-amount 50 --enable-auto-transfer
# 计仓 + 划转一并补全
python scripts/sync_four_exchange_env.py --set-transfer-amount 50 --enable-auto-transfer
pm2 restart crypto-monitor-binance crypto-monitor-okx crypto-monitor-gate crypto-monitor-gate-bot
```