Skip to content

Execution Routing TCP API

Design draft

These commands are planned and not implemented yet.

MngGetExecutionRoutes

Requires see_execution_routes. Returns routes in evaluation order. Optional filters: enabled, target, limit, and offset.

{"command":"MngGetExecutionRoutes","enabled":1}
{
  "snapshot_version":42,
  "count":1,
  "rows":[{
    "route_id":12,"name":"Large EURUSD to dealers","enabled":1,"priority":100,
    "group_mask":"real*","symbol_mask":"EURUSD","action_mask":3,"order_type_mask":3,
    "volume_from":10000,"volume_to":0,"target":1,"target_name":"default",
    "timeout_ms":15000,"comment":"Manual approval","create_time":1785100000,"update_time":1785100000
  }]
}

MngCreateExecutionRoute

Requires manage_execution_routes. The response is sent only after persistence and snapshot publication.

{
  "command":"MngCreateExecutionRoute","name":"Large EURUSD to dealers","enabled":1,
  "priority":100,"group_mask":"real*","symbol_mask":"EURUSD","action_mask":3,
  "order_type_mask":3,"volume_from":10000,"volume_to":0,"target":1,
  "target_name":"default","timeout_ms":15000,"comment":"Manual approval"
}
{"route_id":12,"snapshot_version":43,"data":"OK"}

Defaults: enabled 1, priority 0, masks *, action mask 7, type mask 3, bounds/timeout 0, target INTERNAL.

MngUpdateExecutionRoute

Requires manage_execution_routes. Only supplied fields change; route_id is immutable. Optional expected_snapshot_version provides optimistic concurrency and returns 409 ROUTING_VERSION_CONFLICT on mismatch.

{"command":"MngUpdateExecutionRoute","route_id":12,"enabled":0,"expected_snapshot_version":43}
{"route_id":12,"snapshot_version":44,"data":"OK"}

MngDeleteExecutionRoute

Requires manage_execution_routes. Already resolved dealer requests retain their captured route audit data.

{"command":"MngDeleteExecutionRoute","route_id":12,"expected_snapshot_version":44}
{"route_id":12,"snapshot_version":45,"data":"OK"}

MngReorderExecutionRoutes

Requires manage_execution_routes. Reorders several routes in one DB transaction and publishes one snapshot. Duplicate or missing ids reject the whole request. Equal priorities are resolved by route id.

{
  "command":"MngReorderExecutionRoutes","expected_snapshot_version":45,
  "routes":[{"route_id":20,"priority":10},{"route_id":12,"priority":20}]
}
{"snapshot_version":46,"data":"OK"}

MngResolveExecutionRoute

Requires see_execution_routes. This is a dry run: it uses the live matcher but creates no trade or dealer request. The login must be visible in the caller's group/brand scope.

{
  "command":"MngResolveExecutionRoute","login":2000066,"symbol":"EURUSD",
  "action":1,"order_type":1,"volume":15000
}
{
  "matched":true,"route_id":12,"route_name":"Large EURUSD to dealers",
  "target":1,"target_name":"default","timeout_ms":15000,"snapshot_version":46
}

action must contain exactly one action flag; order_type is BUY or SELL. Optional include_trace=true requires manage_execution_routes and adds evaluated route ids plus the first failed condition. No match returns matched=false and SYSTEM_DEFAULT → INTERNAL.

Planned events

Successful create, update, delete, enable/disable, and reorder operations publish execution.route:event to authorized TCP manager sessions. The payload contains operation, affected route_id values, and snapshot_version. Routing changes are administrative events and are not sent to client accounts.