config.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. env: mainnet
  2. api_base: https://api.pacifica.fi/api/v1
  3. ws_url: wss://ws.pacifica.fi/ws
  4. symbols: [BTC, ETH, SOL]
  5. # 策略选择:grid(网格), scalper(剥头皮), both(混合)
  6. strategy_mode: grid # 推荐先用 grid 验证对冲架构
  7. accounts:
  8. maker:
  9. address: '3v2fE8y6uPVu5pmNCpmygpGNgdP3kGL3SMoVa86uvLLu'
  10. private_key: '5r698iSYYz9NgX19igrAAiRSWzhtFmn98oMbb1KbX1J4JAVtmsy9PS27r37Qofqs7rEcYqdvZF9LVuBva6WtdXmw'
  11. subaccount: maker-01
  12. role: maker
  13. hedger:
  14. address: 'GkFi4YUFVTYKVqzsT98QiiUVbwuTiXWe8XsbRZRYafv3'
  15. private_key: '5RSm4vGQt26ZwHLj1b3gb9TWEU9UEmThxBQ2evubgWxJfXVC5LsNk2x3gnRFZGXq5at3qH82EJq6VgDKPBQvPjud'
  16. subaccount: hedger-01
  17. role: hedger
  18. # ========================================
  19. # 网格策略配置(Grid Trading Strategy)
  20. # ========================================
  21. grid:
  22. enabled: true
  23. # 单标的配置(M1.5 MVP)
  24. symbol: BTC
  25. grid_step_bps: 30 # 网格间距 1%(基于波动率调整:BTC 0.8-1.2%, ETH 1.0-1.5%, SOL 1.5-2.5%)
  26. grid_range_bps: 300 # 网格范围 4%(基于极端波动:BTC 3-5%, ETH 4-6%, SOL 6-10%)
  27. base_clip_usd: 100 # 单层订单大小(USD)
  28. max_layers: 10 # 单边最大层数
  29. hedge_threshold_base: 0.12 # 累积 0.3 BTC 触发对冲(批量对冲模式)
  30. tick_size: 1 # 价格步长
  31. lot_size: 0.00001 # 最小数量步长
  32. # 多标的配置(M2.5 增强版,注释掉则使用上面的单标的配置)
  33. # symbols:
  34. # - symbol: BTC
  35. # grid_step_bps: 100
  36. # grid_range_bps: 400
  37. # base_clip_usd: 500
  38. # max_layers: 4
  39. # - symbol: ETH
  40. # grid_step_bps: 120
  41. # grid_range_bps: 500
  42. # base_clip_usd: 400
  43. # max_layers: 4
  44. # 自适应参数(M1.5+)
  45. adaptive:
  46. enabled: true
  47. volatility_window_minutes: 20 # 波动率计算窗口
  48. min_volatility_bps: 20 # 最低波动率
  49. max_volatility_bps: 200 # 最高波动率
  50. min_grid_step_bps: 10 # 网格间距下限(配置值,会被盘口价差覆盖)
  51. max_grid_step_bps: 100 # 网格间距上限
  52. recenter_enabled: true # 偏离阈值后自动重置
  53. recenter_threshold_bps: 150 # 偏离阈值
  54. recenter_cooldown_ms: 300000 # 重置冷却时间
  55. min_step_change_ratio: 0.2 # 调整间距的最小相对变化
  56. tick_interval_ms: 60000 # 自适应检查间隔
  57. hedge_pending_timeout_ms: 30000 # 对冲挂单超过阈值仍未成交则告警
  58. post_only_cushion_bps: 5 # PostOnly 保护缓冲(防止价格穿过盘口)
  59. # 趋势检测与暂停(M2.5)
  60. trend_filter:
  61. enabled: false # MVP 阶段建议关闭
  62. lookback_periods: 12 # 12 * 5min = 1 hour
  63. trend_threshold_bps: 50 # 1 小时涨跌 > 0.5% 暂停网格
  64. # 低波动监控(M2.5)
  65. volatility_monitor:
  66. enabled: false
  67. min_daily_range_bps: 80 # 日内波动 < 0.8% 时告警
  68. action: notify # notify | reduce_step | switch_strategy
  69. # ========================================
  70. # 被动做市 + 剥头皮策略配置(原有策略)
  71. # ========================================
  72. mm:
  73. layers: 2
  74. base_clip_usd: 1000
  75. spread_bps: 1.6
  76. reprice_ms: 300
  77. scalper:
  78. trigger:
  79. spread_bps: 1.8
  80. min_cooldown_ms: 250
  81. tp_bps: 3
  82. sl_bps: 6
  83. risk:
  84. max_notional_abs: 100000
  85. max_base_abs: 0.8
  86. max_order_sz: 1
  87. kill_switch_dd_pct: -0.5
  88. hedge:
  89. kp: 0.6
  90. ki: 0.05
  91. qmax: 0.4
  92. min_interval_ms: 200
  93. execution:
  94. max_slippage_bps: 150
  95. min_order_interval_ms: 100