config.example.yaml 3.3 KB

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