Skip to content

fyers_ws.yaml

Controls market data and order WebSocket behavior.

Used By

  • src/fyers_store/adapters/fyers_ws.py

Required Fields

  • version: 1
  • log_path
  • write_to_file
  • litemode
  • reconnect
  • reconnect_retry
  • data_type

Optional Fields

  • data_ws_queue_maxsize (0 means unbounded)
  • order_ws_queue_maxsize (0 means unbounded)
  • data_ws_batch_size (1 to 100)
  • data_ws_subscribe_cooldown_seconds
  • data_ws_health_check_seconds
  • data_ws_stale_after_seconds
  • reconnect_backoff_base_seconds
  • reconnect_backoff_max_seconds
  • reconnect_backoff_jitter_seconds
  • reconnect_stable_reset_seconds
  • connect_timeout_seconds

Safe Defaults

Keep reconnect backoff enabled and batch size at or below 100.

Dangerous Values

  • Unbounded queues on long-running sessions can lead to memory pressure.
  • Disabling reconnect backoff can create reconnect storms.

Example

version: 1
log_path: "logs"
write_to_file: false
litemode: true
reconnect: true
reconnect_retry: 10
data_type: "SymbolUpdate"
data_ws_queue_maxsize: 50000
order_ws_queue_maxsize: 5000
data_ws_batch_size: 100
data_ws_subscribe_cooldown_seconds: 0.1
data_ws_health_check_seconds: 30
data_ws_stale_after_seconds: 60
reconnect_backoff_base_seconds: 1.0
reconnect_backoff_max_seconds: 30.0
reconnect_backoff_jitter_seconds: 0.5
reconnect_stable_reset_seconds: 30.0
connect_timeout_seconds: 10

Scenario Example

Scenario: Subscribing to 2000 symbols causes disconnections. - Use data_ws_batch_size at 100. - Add a small data_ws_subscribe_cooldown_seconds. - Watch for backlog warnings in logs.