Developer Guide
Signed Swap Operations Runbook
Operational procedures for rollout, monitoring, signer governance, and incident handling of signed quote mode.
Scope
This runbook covers Model 2 signed quote operations.
Core invariant:
- no quote => pure AMM pass-through
- valid quote => signed quote settlement
- invalid supplied quote => revert (no same-transaction fallback)
Rollout Plan
- Configure and verify
quoteSignerfor each target collateral. - Keep
signedQuoteEnableddisabled while validating quote generation and signature pipeline in staging. - Run canary traffic on a small collateral/pool set.
- Monitor quote rejection rates by reason before widening rollout.
- Maintain a fast rollback path (
signedQuoteEnabled = false) per collateral.
Preflight Checklist
- signer key custody and rotation owner are documented
- quote service uses the correct
chainId+verifyingContract poolIdderivation is validated against on-chain pool idexpiryuses Unix seconds (not milliseconds)- replay safeguards for derived replay keys are monitored
- alerts configured for rejection spikes
Monitoring and Alerts
Track these metrics per collateral and pool:
- signed-quote adoption rate (
signed / total swaps) - rejection rate by error (
SignedQuoteExpired,SignedQuoteReplay, etc.) - signer mismatch rate (
SignedQuoteSignerMismatch/SignedQuoteSignerMissing) - policy violation rate (
SignedQuotePolicyViolation) - expiry skew rate (quotes expiring before submission)
Suggested alert posture:
- page on sustained rejection spikes
- page on signer mismatch bursts
- warn on increasing expiry failures
Incident Response
Signer compromise suspected
- Disable signed mode (
signedQuoteEnabled = false) for affected collateral. - Rotate signer (
quoteSigner) to recovery key. - Invalidate upstream quote issuance for compromised signer.
- Re-enable signed mode only after canary validation.
Quote service outage
- Stop routing signed quote requests from clients.
- Route pure AMM pass-through by omitting signed payloads.
- Track user-visible failure rates and latencies.
- Restore signed flow with canary traffic first.
Replay or malformed payload spike
- Inspect source clients and quote service payload construction.
- Confirm version and encoded payload shape in SDK.
- Tighten API validation at quote service boundary.
- Keep signed mode disabled if failures remain elevated.
Operator Actions by Error
| Error | Typical cause | Immediate action |
|---|---|---|
SignedQuoteExpired | stale submission or bad clock | reduce TTL, sync clocks, refresh quote earlier |
SignedQuoteReplay | signed price envelope reused | ensure the quote service issues a fresh envelope for each successful swap attempt |
SignedQuoteTraderMismatch | wrong account binding | rebuild quote with exact trader address |
SignedQuotePoolMismatch | wrong pool id | verify pool id derivation |
SignedQuoteSignerMismatch / SignedQuoteSignerMissing | bad signer config or stale signer | verify quoteSigner, rotate if needed |
SignedQuoteAmountLimitExceeded | swap size exceeds quote envelope | increase quote bound or split order |
SignedQuotePolicyViolation | signed value outside oracle policy envelope | inspect oracle state/policy and reprice |
SignedQuoteModeDisabled | mode off | route pure AMM or re-enable intentionally |
Post-Incident Verification
- rejection rates return to baseline
- no abnormal signer mismatch bursts
- quote service health checks stable
- canary swaps settle cleanly in Model 2