Token-Bucket Refill Aliasing as a Hidden Slippage Engine (Practical Playbook)
Date: 2026-03-16
Category: research
Audience: execution teams with internal throttles/rate-limiters between strategy and venue gateways
Why this matters
Many desks treat rate limiting as a compliance/safety utility, not a slippage driver.
But in live execution, discrete refill behavior in token-bucket limiters can create a hidden cost loop:
- order intents arrive continuously,
- tokens refill in chunks or at coarse intervals,
- child orders bunch near refill boundaries,
- queue priority and markout quality degrade in bursts,
- residual urgency grows, forcing later aggressive cleanup.
The desk sees this as “random intraday noise,” while the root cause is often a deterministic internal control artifact.
1) Mechanism: where aliasing comes from
A token bucket is defined by:
- capacity (B) (tokens),
- refill rate (r) (tokens/sec),
- available tokens (x_t\in[0,B]).
Idealized continuous refill:
[ \frac{dx_t}{dt} = r - u_t,\quad x_t\in[0,B] ]
where (u_t) is token consumption by outbound order messages.
In production implementations, refill is often discretized (every (\Delta) ms):
[ x_{k+1} = \min(B, x_k + r\Delta) - u_k ]
If strategy dispatch cadence and refill cadence are harmonically related, the router can phase-lock into a refill-edge burst pattern.
That is not just transport jitter; it changes fill quality and queue outcomes.
2) Slippage branch model
Model child-order outcomes under three branches:
- Smooth branch (no debt): stable queue interaction, expected cost (C_s)
- Burst branch (debt then release): clustered sends, expected cost (C_b)
- Reject/retry branch (saturation): additional delay and queue reset, expected cost (C_r)
Expected per-parent cost:
[ E[C] = p_s C_s + p_b C_b + p_r C_r ]
with (C_b > C_s) and usually (C_r > C_b) in stressed books.
Key point: you can reduce (E[C]) materially without changing alpha, by reducing (p_b) and (p_r).
3) Observable metrics to detect limiter-driven slippage
Track these per strategy-symbol-venue-time bucket:
3.1 Token Debt Ratio (TDR)
[ TDR = \frac{\sum_t \max(0, d_t - x_t)}{\sum_t d_t} ]
- (d_t): token demand at time (t)
- (x_t): available tokens before consumption
High TDR means intent flow frequently outruns allowed flow.
3.2 Refill Boundary Hit Rate (RBHR)
Fraction of sent messages occurring within (\pm\epsilon) of refill boundaries.
High RBHR indicates phase concentration near refill edges.
3.3 Burst Concentration Index (BCI)
[ BCI = \frac{\max_w N_w}{\sum_w N_w} ]
- (N_w): messages in micro-window (w) (e.g., 10–25 ms).
High BCI means sends are clustered, not smoothly paced.
3.4 Boundary Markout Penalty (BMP)
[ BMP_{\tau} = E[M_{\tau}\mid \text{boundary send}] - E[M_{\tau}\mid \text{non-boundary send}] ]
for (\tau\in{1s,5s,30s}).
If BMP is persistently adverse, limiter timing is economically relevant.
3.5 Refill-Burst Reject Rate (RBR)
Reject probability conditional on high local burstiness (top BCI decile).
4) Feature contract for modeling
Add control-plane features to slippage models (many teams omit these):
- current token count, bucket capacity, refill quantum, refill interval,
- internal gateway queue length,
- send timestamp modulo refill interval,
- recent token debt and burstiness statistics,
- reject/retry counters and ack latency tails,
- strategy urgency + deadline residual.
Without these, models misattribute control artifacts to market microstructure.
5) State machine for live control
Use an explicit limiter-aware execution state machine:
FLOW_STABLE
- low TDR, low BCI, acceptable BMP
- normal tactic set
DEBT_BUILDING
- TDR rising, queue debt accumulating
- reduce churn (cancel/replace), widen no-touch bands
ALIASED_BURST
- high RBHR/BCI + adverse BMP
- enforce smoothing controls and anti-phase dispatch
SAFE_PACING
- reject spikes or severe burst penalty
- hard cap message rate, reserve tokens for exits/cancels, prioritize completion reliability over micro-optimizing spread capture
Require hysteresis to avoid flapping.
6) Practical controls that usually work
Control A — Continuous (greedy) refill, not coarse interval refill
Prefer implementations that refill proportionally to elapsed time, not all-at-once per large interval.
Control B — Randomized micro-jitter on dispatch
Add tiny bounded jitter to child dispatch timing to break phase-lock with refill ticks.
Control C — Class-based token reservation
Separate token budgets by message class:
- lane 1: risk-critical cancels/kill actions,
- lane 2: passive quoting/maintenance,
- lane 3: aggressive completion.
Prevents passive churn from starving urgent control traffic.
Control D — Burst debt budget
If debt exceeds threshold, temporarily switch from “opportunistic queueing” to “completion-safe pacing” until debt normalizes.
Control E — Refill-aware scheduling objective
Optimize for:
[ Score = E[IS] + \lambda_{tail}Q95(IS) + \lambda_{debt} \cdot DebtRisk ]
with DebtRisk derived from projected token deficits and burst probability.
7) Validation protocol
Offline replay
- Reconstruct token state on historical logs.
- Label boundary vs non-boundary sends.
- Estimate BMP and branch-cost deltas by regime.
Shadow mode
- Run smoothing policy in parallel (no live effect).
- Compare projected vs realized costs under matched parent slices.
Canary
- 5–10% symbol bucket traffic,
- hard rollback on completion degradation or adverse p95 drift.
Promotion gates should include:
- TDR reduction,
- BCI reduction,
- RBR reduction,
- no significant completion hit,
- p95 slippage non-inferiority (preferably improvement).
8) Failure patterns to avoid
Single global limiter across all strategies
- one noisy strategy can impose burst debt on unrelated flow.
No class priority
- critical cancels compete with low-value quote maintenance.
Optimizing only average cost
- tail slippage and deadline misses worsen despite better mean.
Ignoring internal timestamp quality
- bad internal timing can fake or hide refill-boundary effects.
No incident taxonomy
- burst-induced rejects and market-driven rejects get mixed; remediation becomes guesswork.
9) 10-day implementation plan
Days 1–2
Instrument limiter telemetry (token state, debt, refill boundary markers).
Days 3–4
Build TDR/RBHR/BCI/BMP dashboard by symbol-strategy-venue bucket.
Days 5–6
Estimate branch model (smooth vs burst vs reject/retry) and quantify cost deltas.
Days 7–8
Implement continuous refill + class reservations + anti-phase jitter in shadow mode.
Day 9
Canary rollout with strict rollback triggers.
Day 10
Freeze runbook v1 and schedule weekly recalibration.
Bottom line
Rate limiting is not only a safety mechanism; it is a microstructure participant in your execution stack.
If limiter refill mechanics are coarse or phase-locked, they can create deterministic burstiness that leaks into queue quality, markout, and deadline risk.
Treat token debt and burst aliasing as first-class slippage features, and you can usually recover meaningful basis points without touching signal generation.
References
RFC 2697: A Single Rate Three Color Marker
https://www.rfc-editor.org/rfc/rfc2697RFC 2698: A Two Rate Three Color Marker
https://www.rfc-editor.org/rfc/rfc2698Linux
tc-tbfman page (Token Bucket Filter)
https://man7.org/linux/man-pages/man8/tc-tbf.8.htmlAn Introduction to Computer Networks – Token Bucket chapter
https://intronetworks.cs.luc.edu/current/html/tokenbucket.html