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=....
Background reading
Prerequisites¶
- Chapters 01-18 completed.
GW_ADMINconfigured withrole: 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:
Or with CLI:
Verification:
- The
TRADER02console is not told it was kicked; its prompt looks unchanged. Confirm the disconnect from the operator side withGATEWAYS(TRADER02now showsnounder Connected), and from the trader side by sending any order: it is refused withcode=AUTH_REQUIRED Gateway not connected: TRADER02. - Leave that console (
EXIT) and reconnect with a fresh one:
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:
Or with CLI:
Verify from MM gateway:
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:
Or with CLI:
Verify:
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:
- Detect suspicious behavior on one gateway.
KICKthe gateway.QCANCELone affected MM quote.CANCEL_SYMfor one stressed symbol.SESSION|STATE=CONTINUOUSto 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:
KICKfor participant disconnection.QCANCELfor targeted MM quote cancellation.CANCEL_SYMfor 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