Gap Analysis Report #361
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#361
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?
CL8Y DEX Terra Classic — Gap Analysis
1781239451main@8408689gaps/GAP_1780200149.md(2026-05-31)Methodology
Fresh code-grounded pass over the monorepo (contracts, indexer, frontend, bots, CI/docs). Prior gap register items were re-verified against current source. Automated checks run in this session:
make test-contractscl8y-dex-tests)make test-frontendmake test-frontend-chartsmake test-indexer-integrationmake lintmake test-e2e-tx)make test-charts-integration:3001Measured snapshot:
scripts/bots/,packages/localnet-trading-swarm/)Out of scope (by design): bridge / cross-chain.
Executive summary
CL8Y DEX remains a mature Terra Classic CosmWasm stack with strong engineering discipline: checked math, pool-favorable rounding, shared
dex-commonslippage logic, bounded on-chain work, documented invariant→test matrices, hardened indexer API (allowlists, rate limits, sanitized errors), and a feature-rich React dApp (swap, trade, limits, pool, portfolio, charts, fee tiers).Since the May 2026 analysis, several critical indexer and frontend gaps were closed: block tx pagination, cursor discipline on indexing failures, reorg halt, LCD 502 sanitization, swap/trade
min_receivedvia BigInt slippage floor (#356), hybrid book submit snapshot alignment (#360), post-sign broadcast recovery (#359), and swap-page indexer outage UX.The most material remaining gaps cluster into five themes:
make teststill covers only contracts + frontend unit; no hosted test CI gate on MRs; no coverage thresholds; dependency/SCA scanning absent; E2E not run in this pass./metrics;/healthis a static{"status":"ok"}with no DB/LCD probe; trader tier sync is O(unique traders) every 10 min./pool; a11y axe gate covers trade/charts/wallet chrome only (not swap, limits, pool, portfolio); E2E remains Chromium-only.parseFloatstill used for input gating and price-impact display on swap (not submit path); fee-discount registryErrsilently charges full fee; route solver tier depends on indexer sync lag.Pool-only (v2) launch remains feasible with documented ops checklists. Hybrid-as-default retail is materially improved but still depends on indexer/LCD availability and honest outage disclosure. Indexer ingestion is significantly hardened; hosted test automation is now the top process gap.
1. Severity register (top findings)
CriticalOk;MaxRetriesExceededhalts with cursor unchangedCriticalget_block_txspaginates untilpagination.totalsatisfied.gitlab-ci.ymlpublishes QA wasm/indexer artifacts only;make test= contracts + frontend unit; indexer/charts/E2E/swarm excludedMakefile:336;.gitlab-ci.ymlHighHighmin_receivedviaparseFloaton raw integersuseSubmitAlignedSimQuote+applySlippagePercentFloor(BigInt)add_messages)factory/src/contract.rsHighsecurity.rs::lcd_failure_returns_sanitized_502_bodyroute/solve/best, deep limit-book, CG/CMC orderbook — rate limit optional in configrate_limit_lcd_heavy_rpssetHighcargo-audit/cargo-deny/npm audit/Dependabotdocs/security-model.md:130-132vitest.config.tshas no thresholds); axe a11y E2E on trade/charts/wallet onlyvitest.config.ts:19-22;e2e/a11y-critical-routes.spec.ts/metrics; shallow/health(no DB/LCD probe)api/mod.rs:359-361; GitLab #200terraBroadcast.ts,terraTxRecoveryPoll.tsMediumsimQuery.isErrorhandlingdetectSwapIndexerOutage, outage bannersErr(_)→ full fee charged silentlypair/src/contract.rsMediumSetDiscountRegistryAllunboundedMediumvolume_24hper-request aggregationMedium/poolplaywright.config.ts:59-76Medium@goblinhunt/cosmes+ patch-package — supply-chain drift if postinstall skippedfrontend-dapp/package.json;cosmesPatch127.test.tsparseFloatstill used for input validation and price-impact % on swap (display-only; submit path is BigInt-safe)SwapPage.tsx:172,762-766indexer/src/indexer/trader_tracker.rs:20-70scripts/smoke-pool-swap.shnot in any CI gategch-cloud-init-runner.sh) provisions agent VMs but does not yet enforce the fullmaketest ladder on every mergegch-cloud-init-runner.sh; recentchore: wire GCH job secretscommits2. Smart contracts (
smartcontracts/)Toolchain:
cosmwasm-std1.5.11; releaseoverflow-checks = true. All main contracts implementcw2versioning +migrate.Strengths
dex-commonmax-spread/slippage helpers.traderis set.cl8y-dex-testscovering adversarial tokens, pause, blacklist, hybrid, router hops.Gaps
3. Indexer (
indexer/)Strengths
pair_volume_24hrollup; paginated pair/token/CG endpoints.Gaps
/metrics; shallow/health4. Frontend (
frontend-dapp/)Strengths
min_received/ LP withdraw mins viarawAmountMath.ts.lightweight-chartsVitest layer; 30 Playwright specs.Gaps
/swap,/limits,/pool,/portfolioparseFloaton price-impact display5. Bots & tooling (
scripts/bots/,packages/localnet-trading-swarm/)Strengths
localnet-trading-swarmwith gas alignment tests shared with frontendSWAP_GAS_BUFFER.start-qa, redeploy decision guide (#325), issue verify scripts.Gaps
make testmake test+test-e2e-txladder when LocalTerra available6. CI, testing & process
Current state
make test?make test-indexer-integrationseparate)make test-frontend-charts)make test-charts-integration)make test-e2e-tx)make lint)Reference GitHub workflows (
.github/workflows/test.yml) document the intended ladder but are not executed.Gaps
make setup-cloud-localterra(~10–15 min).smoke-pool-swap.shshould run after every deploy in QA.7. Recommended next steps (prioritized)
P0 — Before mainnet with meaningful TVL
make lint,make test,make test-indexer-integration,make test-frontend-charts./healthprobes DB + LCD) and Prometheus metrics (#200).P1 — Retail readiness
make test-e2e-tx) on QA after contract changes.P2 — Hardening & scale
rawAmountMath,terraBroadcast, route solver).8. Test run log (this session)
Point-in-time analysis. Prefer the live GitLab backlog for authoritative issue status. Items marked Fixed were verified in source during this pass.
Operational observability & Automation enforcement is rejeced as excessive overhead at this scale (>$1m tvl) but will be needed at higher tvl. Same reason for firefix/webkit.
Must investigate the tier sync issue O(unique traders)
Approved: C3, H7, H12, M2, M6 (keep succinct), M9, M10, M11, M12, H10 (a11y should be on all pages, no enforced coverage gate)
Rejected due to overhead: C4, H10 (enforced coverage gate only), H11, M13
Rejected due to security model:
H3 (intendend behavior to prevent withdawl of assets during an ongoing exploit)
H5 (Must switch to multisig after $1m+ tvl
H9 (Requires $50k+ in projected annual revenues to fund audit)
Rejected due to intended behavior:
H4 (hooks should be allowed to revert swaps if attached to a pair. Hooks must be approved by governance)
Recommendations approved:
Extend a11y axe coverage to swap, limits, pool, portfolio.
Add IL / LP risk disclosure on pool page.
Reorg auto-replay or operator alert + one-click replay job.
Event-driven fee-tier sync instead of full trader scan.
mentioned in issue #362
mentioned in issue #363
mentioned in issue #364
mentioned in issue #365
mentioned in issue #366
mentioned in issue #367
mentioned in issue #368
Child issues opened from gap analysis triage
Reviewed parent body + triage comment (2026-06-12). Opened 7 issues for approved items; skipped rejected / deferred items. No prior child links existed on #361.
Opened
Bundling notes
/swap/limits/pool/portfolio.smoke-pool-swap.shhook instart-qaplus Playwright post-sign broadcast recovery (Simulated Wallet; Keplr parity documented).Skipped — rejected (excessive overhead at current TVL)
/metrics; deep/healthmaketest ladderSkipped — rejected (security model / deferred)
Skipped — rejected (intended behavior)
Skipped — already fixed (verified in #361 body)
C1, C2, H1, H2, H6, H8, M1, M3, M4, M5, M7 (Firefox portion rejected anyway), M8 — no new issues.
Already closed / superseded references
mentioned in merge request !871
mentioned in merge request !872
mentioned in merge request !873
mentioned in merge request !875
mentioned in issue #373
mentioned in issue #374
mentioned in issue #375
mentioned in merge request !893