config.example.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. post_only_cushion_bps: 5
  58. min_layers: 8
  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: 0.2
  87. kill_switch:
  88. drawdown_pct: 0.5
  89. triggers:
  90. - type: delta_abs
  91. threshold: 1.6
  92. - type: hedge_failure_count
  93. threshold: 3
  94. - type: data_gap_sec
  95. threshold: 3
  96. - type: pnl_drawdown
  97. threshold: 1.0
  98. hedge:
  99. kp: 0.6
  100. ki: 0.05
  101. qmax: 0.4
  102. min_interval_ms: 200
  103. execution:
  104. max_slippage_bps: 5
  105. min_order_interval_ms: 250
  106. funding:
  107. poll_interval_ms: 60000