Security: no runbook command or query identifies top pools by TVL or liquidity during incident [SEC-G03] #436
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#436
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
No runbook includes a command, SQL query, or API call that returns CL8Y DEX pairs sorted by approximate TVL or quote liquidity. During an incident, an operator needs to quickly identify which pools have the most value at risk. The incident triage template (
incident-dex-indexer.md) does not include this query. None of the operational runbooks (emergency-commands.md,blacklist-decision.md,indexer-reorg-replay-dedup.md) include a pair ranking query.What Was Checked
docs/templates/incident-dex-indexer.md: triage section checks contract pause state and tx codes. No query to rank pools by value.docs/runbooks/emergency-commands.md: contains pause/blacklist commands per pair address. Requires the operator to already know which pair to target. No pool ranking query.docs/runbooks/blacklist-decision.md: decision tree by scope, not by pool value ranking.docs/integrators.md: lists indexer API endpoints. No specific runbook command to sort pairs by TVL or liquidity.Expected (per checklist)
A runbook must include a command or query (SQL against the indexer DB, or an indexer API call) that returns all pairs sorted by descending approximate TVL or quote asset liquidity. This allows an operator to prioritize which pools to investigate or protect first during an incident.
Actual
No such command or query exists in any runbook. During an active incident, an operator would have to either query the frontend or construct a DB query without guidance.
Evidence
docs/templates/incident-dex-indexer.md: no pool-ranking query in triage sectiondocs/runbooks/emergency-commands.md: requires$PAIR_ADDRto already be known, no discovery stepSuggested Fix
Add a "Quick pool triage" section to
docs/templates/incident-dex-indexer.mdordocs/runbooks/emergency-commands.mdwith a SQL snippet or indexer API call that returns pairs sorted by descending reserve value. Example:SELECT pair_address, asset_0_reserve, asset_1_reserve FROM pairs ORDER BY (asset_0_reserve + asset_1_reserve) DESC LIMIT 10;(adjusted for actual schema). If the indexer API has a pairs endpoint that includes reserve values, document that call with the sort parameter.Verification Checklist
emergency-commands.mdLabels
security,pre-launchCc: @PlasticDigits
mentioned in issue #381
mentioned in merge request !968
Verified #436 at the docs + live-query layer (issue-436-pool-triage-sec-g03).
Guard: check_pool_triage_docs.py -> OK; verify-issue-436.sh -> PASS 4 / SKIP 1 (the SQL smoke skips in a bare checkout with no env file — ran it by hand against the live indexer instead).
Documented blocks, run live:
Both checklist items map: the desc-ranked SQL/API lives in emergency-commands.md "Quick pool triage (SEC-G03)" and the incident-template triage links it.
Docs + indexer SQL only, no redeploy. Good to close from my side — @PlasticDigits merge !968 + close.
mentioned in commit
f28cdd4d52mentioned in merge request !969
mentioned in merge request !970
Verification — #436 (SEC-G03 pool triage)
Verified on
mainafter merge of !968 (7f1429d8). No repo changes required from this pass.Acceptance checklist
docs/runbooks/emergency-commands.md§ Quick pool triage (SEC-G03) — reserve SQLORDER BY approx_liquidity_units DESC, quote-side SQLORDER BY quote_reserve_human DESC, APIGET /api/v1/pairs?sort=volume_24h&order=descemergency-commands.mddocs/templates/incident-dex-indexer.mdtriage linksemergency-commands.md#quick-pool-triage-sec-g03; runbook section presentAutomated / guard
make check-pool-triage-docsmake verify-issue-436skills/AGENTS_POOL_TRIAGE.mddocs/security-model.md,skills/AGENTS_EMERGENCY_COMMANDS.mdLive query (manual)
make setup-indexer-postgres→sqlx migrate run→ runbook SQL viadocker compose exec postgres psqlpair_reservesschema; 0 rows (Postgres-only, no LocalTerra deploy)curl …/api/v1/pairs?sort=volume_24h&order=descmake setup-cloud-localterra). Documented call matches prior verification on deployed stack (see @Brouie note 2026-06-30).Closing — implementation merged and docs/guards green.