Context
Signing cost on the submission hot path is 1–5 ms of deterministic jitter. Currently cmd/executor/bundle.go constructs and signs each arbitrage transaction fresh per opportunity. Pre-signing templates for expected input-amount buckets removes this jitter and lets the executor ship whichever template matches the observed opportunity immediately.
This work is purely in-binary — no external service dependencies, no new credentials, no recurring cost.
Scope
Pre-signed transaction template pool
- New module:
cmd/executor/template.go
- Template keyed by
(token_pair, protocol_mix, amount_bucket)
- Amount buckets (tunable): 10, 25, 50, 100, 250, 500, 1000 WETH equivalent
- Signed at startup + rotation ticker (e.g., every N blocks or on nonce advance)
- Nonce pre-allocation window: reserve next K nonces for templates, track in
cmd/executor/nonce.go
- Submitter picks closest template by
(pair, protocol_mix, amount_bucket), mutates only slippage-independent fields (deadline, tipBps, minProfitOut)
Metrics
aether_template_pool_size gauge
aether_template_cache_hit_ratio gauge (rolling 1-minute window)
aether_template_rotation_duration_ms histogram (rotation should not stall hot path)
Safety
- Template signing happens on a background goroutine, never on the arb-dispatch path
- If template cache misses (unusual pair or amount out of bucket), fall back to fresh signing path — no regression
- On reorg detection, invalidate templates with nonces ≤ last confirmed
Acceptance criteria
Files touched (expected)
cmd/executor/template.go (new)
cmd/executor/nonce.go (expose reservation API)
cmd/executor/submitter.go (template-path branch)
cmd/executor/executor.go (wire template cache into submit flow)
cmd/executor/template_test.go (new)
Out of scope
- L2 / non-Ethereum submit paths (explicitly not part of this effort)
- Private mempool integration (deferred, under discussion)
Context
Signing cost on the submission hot path is 1–5 ms of deterministic jitter. Currently
cmd/executor/bundle.goconstructs and signs each arbitrage transaction fresh per opportunity. Pre-signing templates for expected input-amount buckets removes this jitter and lets the executor ship whichever template matches the observed opportunity immediately.This work is purely in-binary — no external service dependencies, no new credentials, no recurring cost.
Scope
Pre-signed transaction template pool
cmd/executor/template.go(token_pair, protocol_mix, amount_bucket)cmd/executor/nonce.go(pair, protocol_mix, amount_bucket), mutates only slippage-independent fields (deadline, tipBps, minProfitOut)Metrics
aether_template_pool_sizegaugeaether_template_cache_hit_ratiogauge (rolling 1-minute window)aether_template_rotation_duration_mshistogram (rotation should not stall hot path)Safety
Acceptance criteria
aether_template_rotation_duration_ms)Files touched (expected)
cmd/executor/template.go(new)cmd/executor/nonce.go(expose reservation API)cmd/executor/submitter.go(template-path branch)cmd/executor/executor.go(wire template cache into submit flow)cmd/executor/template_test.go(new)Out of scope