Skip to main content

truncate_cl_ord_id

Function truncate_cl_ord_id 

Source
pub fn truncate_cl_ord_id(client_order_id: &ClientOrderId) -> String
Expand description

Truncates a ClientOrderId for Kraken’s cl_ord_id field.

Kraken accepts three formats:

  • Long UUID (36 chars with hyphens): passed through
  • Short UUID (32 hex chars): passed through
  • Free text: max 18 chars

Sequential NautilusTrader IDs (e.g. O202602270023210040011) exceed the 18-char free-text limit. These are truncated to ‘O’ + last 17 chars, preserving the counter portion for maximum entropy.