config.example.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. # 单标的配置(M1.5 MVP)
  23. symbol: BTC
  24. grid_step_bps: 100 # 网格间距 1%(基于波动率调整:BTC 0.8-1.2%, ETH 1.0-1.5%, SOL 1.5-2.5%)
  25. grid_range_bps: 400 # 网格范围 4%(基于极端波动:BTC 3-5%, ETH 4-6%, SOL 6-10%)
  26. base_clip_usd: 500 # 单层订单大小(USD)
  27. max_layers: 4 # 单边最大层数
  28. hedge_threshold_base: 0.3 # 累积 0.3 BTC 触发对冲(批量对冲模式)
  29. tick_size: 1 # 价格步长
  30. lot_size: 0.00001 # 最小数量步长
  31. # 多标的配置(M2.5 增强版,注释掉则使用上面的单标的配置)
  32. # symbols:
  33. # - symbol: BTC
  34. # grid_step_bps: 100
  35. # grid_range_bps: 400
  36. # base_clip_usd: 500
  37. # max_layers: 4
  38. # - symbol: ETH
  39. # grid_step_bps: 120
  40. # grid_range_bps: 500
  41. # base_clip_usd: 400
  42. # max_layers: 4
  43. # 自适应参数(可选)
  44. adaptive:
  45. enabled: true
  46. volatility_window_minutes: 30
  47. min_volatility_bps: 20
  48. max_volatility_bps: 200
  49. min_grid_step_bps: 10
  50. max_grid_step_bps: 100
  51. recenter_enabled: true
  52. recenter_threshold_bps: 150
  53. recenter_cooldown_ms: 300000
  54. min_step_change_ratio: 0.2
  55. tick_interval_ms: 60000
  56. hedge_pending_timeout_ms: 30000
  57. # 趋势检测与暂停(M2.5)
  58. trend_filter:
  59. enabled: false # MVP 阶段建议关闭
  60. lookback_periods: 12 # 12 * 5min = 1 hour
  61. trend_threshold_bps: 50 # 1 小时涨跌 > 0.5% 暂停网格
  62. # 低波动监控(M2.5)
  63. volatility_monitor:
  64. enabled: false
  65. min_daily_range_bps: 80 # 日内波动 < 0.8% 时告警
  66. action: notify # notify | reduce_step | switch_strategy
  67. # ========================================
  68. # 被动做市 + 剥头皮策略配置(原有策略)
  69. # ========================================
  70. mm:
  71. layers: 2
  72. base_clip_usd: 1000
  73. spread_bps: 1.6
  74. reprice_ms: 300
  75. scalper:
  76. trigger:
  77. spread_bps: 1.8
  78. min_cooldown_ms: 250
  79. tp_bps: 3
  80. sl_bps: 6
  81. risk:
  82. max_notional_abs: 100000
  83. max_base_abs: 0.8
  84. max_order_sz: 0.2
  85. kill_switch:
  86. drawdown_pct: 0.5
  87. triggers:
  88. - type: delta_abs
  89. threshold: 1.6
  90. - type: hedge_failure_count
  91. threshold: 3
  92. - type: data_gap_sec
  93. threshold: 3
  94. - type: pnl_drawdown
  95. threshold: 1.0
  96. hedge:
  97. kp: 0.6
  98. ki: 0.05
  99. qmax: 0.4
  100. min_interval_ms: 200
  101. execution:
  102. max_slippage_bps: 5
  103. min_order_interval_ms: 250
  104. funding:
  105. poll_interval_ms: 60000