config.example.yaml 3.3 KB

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