Skip to content

Advanced Admin Operations

Objective

Practice advanced exchange-operator controls that are documented but were not covered in earlier training chapters: KICK, QCANCEL, CANCEL_SYM, and manual session overrides via SESSION|STATE=....

Prerequisites

  • Chapters 01-18 completed.
  • GW_ADMIN configured with role: ADMIN.
  • Engine and at least one trader and one MM gateway connected.

Background

Earlier risk-control exercises focused on halt/resume and kill switch. In live operations, admins also need targeted controls for:

  • Disconnecting a specific participant (KICK).
  • Cancelling one MM quote on one symbol without killing the whole gateway (QCANCEL).
  • Clearing one symbol's resting book across all gateways (CANCEL_SYM).
  • Forcing session state for controlled drills (SESSION|STATE=...).

These controls exist in both:

  • Interactive admin console (pm-admin / ALF commands).
  • One-shot scripting CLI (pm-admin-cli).

Use a separate identity for each operator client

The interactive console uses GW_ADMIN; one-shot commands use ADMIN_CLI. The chapter 01 configuration defines both as ADMIN so the console and CLI can stay connected at once. A duplicate live connection with the same participant ID is refused.

Exercise 1: Disconnect a Gateway with KICK

From admin console:

[GW_ADMIN|ADMIN]> KICK|GW=TRADER02|REASON=Training_disconnect_check

Or with CLI:

pm-admin-cli --id ADMIN_CLI kick --gw TRADER02 --reason "Training disconnect check"

Verification:

  1. The TRADER02 console is not told it was kicked; its prompt looks unchanged. Confirm the disconnect from the operator side with GATEWAYS (TRADER02 now shows no under Connected), and from the trader side by sending any order: it is refused with code=AUTH_REQUIRED Gateway not connected: TRADER02.
  2. Leave that console (EXIT) and reconnect with a fresh one:
pm-alf-console --id TRADER02

Checkpoint: gateway is disconnected and can reconnect cleanly.

Exercise 2: Cancel One MM Quote with QCANCEL

First ensure an MM has an active quote on AAPL.

From admin console:

[GW_ADMIN|ADMIN]> QCANCEL|GW=MM_AAPL_01|SYM=AAPL

Or with CLI:

pm-admin-cli --id ADMIN_CLI qcancel --gw MM_AAPL_01 --sym AAPL

Verify from MM gateway:

[MM_AAPL_01]> QLEGS|SYM=AAPL|SHOW=ALL

You should see the prior quote legs no longer active.

When to use this instead of manual MM-side QUOTE_CANCEL: use QCANCEL when the MM process is unresponsive or when operations needs immediate symbol-scoped intervention without relying on the MM terminal.

Checkpoint: one-symbol MM quote is cancelled without mass-cancelling all gateway orders.

Exercise 3: Clear One Symbol Book with CANCEL_SYM

Create a few resting orders on TSLA from multiple gateways, then run:

From admin console:

[GW_ADMIN|ADMIN]> CANCEL_SYM|SYM=TSLA

Or with CLI:

pm-admin-cli --id ADMIN_CLI cancel-sym --sym TSLA

Verify:

pm-admin-cli --id ADMIN_CLI book --sym TSLA

Confirm TSLA resting orders were cleared while other symbols remain unchanged.

Checkpoint: symbol-scoped cancel works across gateways.

Exercise 4: Force Session State for Controlled Drills

Set session state explicitly. Transitions are validated by the engine: from CLOSED the only legal move is PRE_OPEN, and PRE_OPEN must precede CONTINUOUS. The sequence below starts from CLOSED; if the market is open (CONTINUOUS), the first two requests are ignored and the console or CLI only prints a timeout, so start from the step that matches SESSION_STATUS (an illegal jump is silently ignored).

From admin console:

[GW_ADMIN|ADMIN]> SESSION|STATE=PRE_OPEN
[GW_ADMIN|ADMIN]> SESSION|STATE=CONTINUOUS
[GW_ADMIN|ADMIN]> SESSION|STATE=CLOSING_AUCTION
[GW_ADMIN|ADMIN]> SESSION|STATE=CLOSED

Or with CLI:

pm-admin-cli --id ADMIN_CLI session --state PRE_OPEN
pm-admin-cli --id ADMIN_CLI session --state CONTINUOUS
pm-admin-cli --id ADMIN_CLI session --state CLOSING_AUCTION
pm-admin-cli --id ADMIN_CLI session --state CLOSED
pm-admin-cli --id ADMIN_CLI session-status

Use this to reproduce auction and close transitions deterministically in training. For example, after reaching CONTINUOUS, requesting CONTINUOUS again is an invalid transition: the engine does not publish a new session.state, so the CLI waits until its timeout. The REST transition endpoint instead returns 409 TRANSITION_REJECTED with the engine's reason.

Checkpoint: forced session transitions are visible and verifiable.

Exercise 5: Run an Incident Micro-Runbook

Simulate a short incident response sequence:

  1. Detect suspicious behavior on one gateway.
  2. KICK the gateway.
  3. QCANCEL one affected MM quote.
  4. CANCEL_SYM for one stressed symbol.
  5. SESSION|STATE=CONTINUOUS to restore normal operation if needed.

Example CLI sequence:

pm-admin-cli --id ADMIN_CLI kick --gw TRADER02 --reason "Training incident"
pm-admin-cli --id ADMIN_CLI qcancel --gw MM_AAPL_01 --sym AAPL
pm-admin-cli --id ADMIN_CLI cancel-sym --sym AAPL
pm-admin-cli --id ADMIN_CLI session-status

TRADER02 is now disconnected: leave its console and start a new one before the next chapter, which needs it.

Checkpoint: you can explain when to use each control and why they are not interchangeable.

Summary

You can now operate advanced admin controls beyond halt/resume:

  • KICK for participant disconnection.
  • QCANCEL for targeted MM quote cancellation.
  • CANCEL_SYM for symbol-wide book clearing.
  • SESSION|STATE=... for deterministic phase management.

Reflection

Why does CANCEL_SYM clear an entire symbol's book while QCANCEL targets only quote-based orders? In an incident where a single market maker's bot is malfunctioning, which of these tools (or KICK, or the Chapter 11 kill switch) would you reach for first, and why is that the least disruptive choice available?

Further Reading

Next: 20 — Closing the Day