Skip to main content

Implement a high-frequency trading strategy

  1. Separate data ingestion, signal generation, order submission, and state reconciliation into distinct pipeline stages.
  2. Bootstrap state from REST before trusting realtime-driven signals.
  3. Keep order acknowledgements, execution outcomes, and settlement effects as separate timing domains in your strategy logic.
  4. Bound risk and exposure before trying to optimize micro-latency details.
  5. Instrument every stage so you can see where real delay enters the system.

Build the strategy loop in the right order

  1. Start with the smallest feed set that can drive the strategy.
  2. Establish one application-owned state model for market data and one for account state.
  3. Generate signals from the local model, not directly from raw WebSocket callbacks.
  4. Submit requests only after the local model includes current constraints and position state.
  5. Reconcile every acknowledgement and later execution outcome back into the same state owner.

Keep timing domains separate

Timing questionTreat it as…
request admitteda fast sequencing or acknowledgement signal
order filled, rejected, or canceleda later execution outcome
account and position updates observedan event-stream reconciliation step
checkpointed or withdrawal-relevant statea later settlement and finality concern
Do not collapse those into one “latency” number inside the strategy.

Optimize the first things that actually matter

  • reduce unnecessary feed subscriptions
  • minimize state-copying between callbacks and decision logic
  • keep one deterministic owner of open-order and position state
  • record enough metadata to rebuild state quickly after reconnect
  • measure delay from data receipt to signal generation to submission to observed outcome

Keep low-latency design inside public guards

  1. Check symbol, tick-size, and minimum-size validity before submission.
  2. Keep notional and margin constraints visible to the strategy before it emits the request.
  3. Expect market orders to respect price-deviation guards and book-liquidity limits.
  4. Treat SafetyFailure and RateLimit as ordinary parts of the strategy runtime, not as impossible edge cases.

Boundary rule

This page explains how to structure a fast strategy around the current public DerivaDEX model. It does not publish a guaranteed latency target or a private market-maker runbook.

Next routes

Last modified on April 13, 2026