Skip to main content

Module order_builder

Module order_builder 

Source
Expand description

Order message builder for dYdX v4 protocol.

This module converts Nautilus order types to dYdX proto messages (MsgPlaceOrder, MsgCancelOrder). It centralizes all order building logic including:

  • Market and limit order construction
  • Conditional orders (stop-loss, take-profit)
  • Short-term vs long-term order routing based on OrderLifetime
  • Price/quantity quantization via market params
  • Dynamic block time estimation via BlockTimeMonitor

The builder produces cosmrs::Any messages ready for transaction building.

Structsยง

OrderMessageBuilder
Builds dYdX proto messages from Nautilus orders.