fix(indexer): set-based CG/CMC aggregator queries + top-100 pagination (#288) #781
No reviewers
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!781
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-6fa7"
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
Closes the remaining AC on https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/288.
The 60s TTL cache (already on main) bounded how often the per-pair N+1 fanout ran; this MR replaces that fanout with O(1) set-based queries and adds option (b) pagination per stakeholder decision: default top 100 pairs by 24h quote volume, with optional limit/offset.
Changes
Acceptance checklist
Verification
cd indexer && cargo test --test api_aggregator_batch --test api_cg --test api_cmc --test api_consolidated_reporting -j 1 -- --test-threads=1
mentioned in issue #288
changed the description
changed the description
Security review
Commit reviewed:
8f72ce6c61c36d07da87513acefc601dea1c089fScope: Set-based CG/CMC aggregator queries (
get_24h_stats_all_pairs,get_24h_hybrid_breakdown_all_pairs), sharedaggregator_snapshotloader, pagination on/cg/tickers,/cmc/summary,/cmc/ticker, and per-endpoint cache keys.Outcome:
FINDINGS: 0medium+Summary
No medium, high, or critical vulnerabilities identified in this diff.
Reviewed attack surfaces:
swap_events.rsuse parameterized$1binds only;limit/offsetnever reach SQL.parse_aggregator_list_queryclampslimitto[1, 1000], boundsoffsetto[0, 10_000](400 above max), and rejects excessive offset. Matches existing/cg/pairspagination pattern.internal_err()(generic 500 body).Inline threads: none (no findings to anchor).
Automated security review (Cursor Cloud Agent)
mentioned in commit
706856fd17