config.example.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. env: mainnet
  2. api_base: ${PACIFICA_API_BASE}
  3. symbols: [BTC, ETH, SOL]
  4. accounts:
  5. maker:
  6. address: ${PACIFICA_MAKER_ADDRESS}
  7. private_key: ${PACIFICA_MAKER_PRIVATE_KEY}
  8. subaccount: maker-01
  9. role: maker
  10. hedger:
  11. address: ${PACIFICA_HEDGER_ADDRESS}
  12. private_key: ${PACIFICA_HEDGER_PRIVATE_KEY}
  13. subaccount: hedger-01
  14. role: hedger
  15. # 策略选择:grid(网格), scalper(剥头皮), both(混合)
  16. strategy_mode: grid # 推荐先用 grid 验证对冲架构
  17. # ========================================
  18. # 网格策略配置(Grid Trading Strategy)
  19. # ========================================
  20. grid:
  21. enabled: true
  22. # 单标的配置(微网格示例 - 根据实盘再调优)
  23. symbol: BTC
  24. grid_step_bps: 1.0 # 网格间距 0.01%,贴近盘口
  25. grid_range_bps: 20 # 网格范围 0.2%
  26. base_clip_usd: 40 # 单层订单大小(USD)
  27. base_clip_equity_pct: 0.01 # 按账户权益比例(1%)动态调整,取最大值
  28. base_clip_leverage: 20 # 动态 clip 杠杆倍数
  29. max_layers: 16 # 单边最大层数
  30. hedge_threshold_base: 0.15 # 累积 0.15 BTC 触发对冲
  31. tick_size: 1 # 价格步长
  32. lot_size: 0.00001 # 最小数量步长
  33. incremental_mode: true
  34. # 成交率闭环(可选)
  35. fill_rate_control:
  36. enabled: false # 测试网默认关闭,可按需求开启
  37. target_fills_per_minute: 25 # 目标成交率(次/分钟)
  38. target_maker_ratio: 0.8 # 目标 maker 占比
  39. max_self_trade_ratio: 0.01
  40. kp_step: 0.02
  41. ki_step: 0.002
  42. kp_clip: 0.1
  43. ki_clip: 0.01
  44. min_grid_step_bps: 0.5
  45. max_grid_step_bps: 3.0
  46. min_clip_usd: 20
  47. max_clip_usd: 80
  48. min_maker_ratio_for_adjust: 0.7
  49. emergency_step_multiplier: 1.4
  50. # 多标的配置(M2.5 增强版,注释掉则使用上面的单标的配置)
  51. # symbols:
  52. # - symbol: BTC
  53. # grid_step_bps: 100
  54. # grid_range_bps: 400
  55. # base_clip_usd: 500
  56. # max_layers: 4
  57. # - symbol: ETH
  58. # grid_step_bps: 120
  59. # grid_range_bps: 500
  60. # base_clip_usd: 400
  61. # max_layers: 4
  62. # 自适应参数(可选)
  63. adaptive:
  64. enabled: true
  65. volatility_window_minutes: 30
  66. min_volatility_bps: 0.5
  67. max_volatility_bps: 6
  68. min_grid_step_bps: 0.6
  69. max_grid_step_bps: 3
  70. recenter_enabled: true
  71. recenter_threshold_bps: 400
  72. recenter_cooldown_ms: 600000
  73. min_step_change_ratio: 0.25
  74. tick_interval_ms: 60000
  75. hedge_pending_timeout_ms: 30000
  76. post_only_cushion_bps: 1
  77. min_layers: 6
  78. max_placement_concurrency: 4
  79. placement_batch_delay_ms: 200
  80. rate_limit_backoff_ms: 500
  81. # 趋势检测与暂停(M2.5)
  82. trend_filter:
  83. enabled: false # MVP 阶段建议关闭
  84. lookback_periods: 12 # 12 * 5min = 1 hour
  85. trend_threshold_bps: 50 # 1 小时涨跌 > 0.5% 暂停网格
  86. # 低波动监控(M2.5)
  87. volatility_monitor:
  88. enabled: false
  89. min_daily_range_bps: 80 # 日内波动 < 0.8% 时告警
  90. action: notify # notify | reduce_step | switch_strategy
  91. # ========================================
  92. # 被动做市 + 剥头皮策略配置(原有策略)
  93. # ========================================
  94. mm:
  95. layers: 2
  96. base_clip_usd: 1000
  97. spread_bps: 1.6
  98. reprice_ms: 300
  99. scalper:
  100. trigger:
  101. spread_bps: 1.8
  102. min_cooldown_ms: 250
  103. tp_bps: 3
  104. sl_bps: 6
  105. risk:
  106. max_notional_abs: 100000
  107. max_base_abs: 0.8
  108. max_order_sz: 0.2
  109. kill_switch:
  110. drawdown_pct: 0.5
  111. triggers:
  112. - type: delta_abs
  113. threshold: 1.6
  114. - type: hedge_failure_count
  115. threshold: 3
  116. - type: data_gap_sec
  117. threshold: 3
  118. - type: pnl_drawdown
  119. threshold: 1.0
  120. hedge:
  121. kp: 0.6
  122. ki: 0.05
  123. qmax: 0.4
  124. min_interval_ms: 200
  125. execution:
  126. max_slippage_bps: 5
  127. min_order_interval_ms: 100
  128. bulk_init_interval_ms: 20
  129. ws_rate_limiter:
  130. burst: 30
  131. refill_per_sec: 10
  132. max_queue_depth: 120
  133. min_order_interval_ms: 250
  134. ws_rate_limiter:
  135. burst: 6
  136. refill_per_sec: 5
  137. max_queue_depth: 60
  138. funding:
  139. poll_interval_ms: 60000