fix(indexer): CMC orderbook response — Openware top-level array wrapper #223

Closed
opened 2026-05-29 05:37:03 +00:00 by PlasticDigits · 11 comments
PlasticDigits commented 2026-05-29 05:37:03 +00:00 (Migrated from gitlab.com)

Summary

Change GET /cmc/orderbook/:market_pair response envelope to match Openware / Peatio CoinMarketCap example: top-level JSON array containing one orderbook object [{ "timestamp", "bids", "asks" }], instead of a single bare object.

Reference: Openware CMC orderbook — response example is an array.

Related: #210, timestamp issue (sibling).


Current codebase

Piece Behavior today
indexer/src/api/cmc.rs cmc_orderbook Returns Json(CmcOrderbookResponse { timestamp, bids, asks }) — object
CmcOrderbookResponse Struct serialized as { ... }
docs/CG_CMC_COMPLIANCE.md § GET /cmc/orderbook Example shows object (not array) — drift from Openware
Other CMC endpoints summary, ticker, trades use arrays at top level where spec requires

CG /cg/orderbook correctly remains a single object with ticker_id (Kujira-style) — out of scope for this issue.


Why this is needed

  1. CMC crawler compatibility: Strict validators may expect the documented Peatio array shape.
  2. Spec fidelity: Compliance doc cites Openware; response must match for listing review.
  3. Consistency within /cmc/: Other CMC endpoints return array-wrapped collections; orderbook is the outlier.

Constraints and guardrails

Area Guardrail
Shape [{ "timestamp", "bids", "asks" }] — exactly one element when pair exists
Errors 404/400/500 unchanged; no empty array success for unknown pair (unless spec mandates — prefer 404)
CG Do not wrap CG orderbook in array
OpenAPI Update body type to Vec<CmcOrderbookResponse> or dedicated wrapper
Breaking change Clients parsing object root must migrate — changelog
Timestamp Coordinate with sibling issue (seconds numeric)

Relevant files

File Role
indexer/src/api/cmc.rs Handler + types
indexer/src/api/mod.rs Route registration
indexer/tests/api_orderbook_lcd_mock.rs, api_cmc.rs JSON shape tests
docs/CG_CMC_COMPLIANCE.md Example JSON

  1. Change handler to Ok(Json(vec![CmcOrderbookResponse { ... }])).
  2. Add test: body.is_array() && body[0]["bids"].is_array().
  3. Update utoipa response schema and compliance example to match Openware verbatim structure.
  4. Document that market_pair is path param; array element does not repeat pair name (per Openware example).

Acceptance criteria

  • Successful CMC orderbook response is JSON array of length 1.
  • Element contains timestamp, bids, asks.
  • OpenAPI + compliance doc updated.
  • CG orderbook still returns object with ticker_id.

Test plan — functional paths

# Scenario Expected
1 Valid market_pair 200, [{...}]
2 Invalid pair format 400, not array
3 Unknown pair 404
4 depth param Array element level counts per depth issue

Test plan — attack vectors / abuse

# Vector Mitigation
A1 Huge array (multiple books) Enforce len == 1
A2 Confusion with CG object Docs + separate tests

Verification criteria

  1. jq 'type' → "array" on live/staging endpoint.
  2. Side-by-side diff with Openware sample structure.
  3. CMC listing checklist signed off.
## Summary Change **`GET /cmc/orderbook/:market_pair`** response envelope to match **Openware / Peatio CoinMarketCap** example: **top-level JSON array** containing **one** orderbook object `[{ "timestamp", "bids", "asks" }]`, instead of a **single bare object**. Reference: [Openware CMC orderbook](https://openware.com/sdk/2.6/docs/peatio/peatio/coin-market-cap) — response example is an **array**. Related: [**#210**](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/210), timestamp issue (sibling). --- ## Current codebase | Piece | Behavior today | |-------|----------------| | [`indexer/src/api/cmc.rs`](indexer/src/api/cmc.rs) `cmc_orderbook` | Returns `Json(CmcOrderbookResponse { timestamp, bids, asks })` — **object** | | [`CmcOrderbookResponse`](indexer/src/api/cmc.rs) | Struct serialized as `{ ... }` | | [`docs/CG_CMC_COMPLIANCE.md`](docs/CG_CMC_COMPLIANCE.md) § `GET /cmc/orderbook` | Example shows **object** (not array) — drift from Openware | | Other CMC endpoints | `summary`, `ticker`, `trades` use **arrays** at top level where spec requires | **CG** `/cg/orderbook` correctly remains a **single object** with `ticker_id` (Kujira-style) — **out of scope** for this issue. --- ## Why this is needed 1. **CMC crawler compatibility**: Strict validators may expect the **documented Peatio array** shape. 2. **Spec fidelity**: Compliance doc cites Openware; response must match for listing review. 3. **Consistency within `/cmc/`**: Other CMC endpoints return array-wrapped collections; orderbook is the outlier. --- ## Constraints and guardrails | Area | Guardrail | |------|-----------| | **Shape** | `[{ "timestamp", "bids", "asks" }]` — **exactly one** element when pair exists | | **Errors** | 404/400/500 unchanged; **no** empty array success for unknown pair (unless spec mandates — prefer 404) | | **CG** | Do **not** wrap CG orderbook in array | | **OpenAPI** | Update body type to `Vec<CmcOrderbookResponse>` or dedicated wrapper | | **Breaking change** | Clients parsing object root must migrate — changelog | | **Timestamp** | Coordinate with sibling issue (seconds numeric) | --- ## Relevant files | File | Role | |------|------| | [`indexer/src/api/cmc.rs`](indexer/src/api/cmc.rs) | Handler + types | | [`indexer/src/api/mod.rs`](indexer/src/api/mod.rs) | Route registration | | [`indexer/tests/api_orderbook_lcd_mock.rs`](indexer/tests/api_orderbook_lcd_mock.rs), [`api_cmc.rs`](indexer/tests/api_cmc.rs) | JSON shape tests | | [`docs/CG_CMC_COMPLIANCE.md`](docs/CG_CMC_COMPLIANCE.md) | Example JSON | --- ## Recommended direction 1. Change handler to `Ok(Json(vec![CmcOrderbookResponse { ... }]))`. 2. Add test: `body.is_array() && body[0]["bids"].is_array()`. 3. Update utoipa response schema and compliance example **to match Openware verbatim structure**. 4. Document that `market_pair` is path param; array element does not repeat pair name (per Openware example). --- ## Acceptance criteria - [ ] Successful CMC orderbook response is JSON **array** of length **1**. - [ ] Element contains `timestamp`, `bids`, `asks`. - [ ] OpenAPI + compliance doc updated. - [ ] CG orderbook still returns **object** with `ticker_id`. --- ## Test plan — functional paths | # | Scenario | Expected | |---|----------|----------| | 1 | Valid `market_pair` | 200, `[{...}]` | | 2 | Invalid pair format | 400, not array | | 3 | Unknown pair | 404 | | 4 | `depth` param | Array element level counts per depth issue | --- ## Test plan — attack vectors / abuse | # | Vector | Mitigation | |---|--------|------------| | A1 | Huge array (multiple books) | Enforce `len == 1` | | A2 | Confusion with CG object | Docs + separate tests | --- ## Verification criteria 1. `jq 'type'` → `"array"` on live/staging endpoint. 2. Side-by-side diff with Openware sample structure. 3. CMC listing checklist signed off.
PlasticDigits commented 2026-05-29 05:37:04 +00:00 (Migrated from gitlab.com)

marked as related to #210

marked as related to #210
PlasticDigits commented 2026-05-29 05:37:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #210

mentioned in issue #210
PlasticDigits commented 2026-05-29 08:40:21 +00:00 (Migrated from gitlab.com)

mentioned in commit fdcc0c20b1

mentioned in commit fdcc0c20b18a728a63dab1b38fe6670dba1f693f
PlasticDigits commented 2026-05-29 08:40:30 +00:00 (Migrated from gitlab.com)

Resolution (shipped on main @ fdcc0c2)

The Openware Peatio array wrapper for GET /cmc/orderbook/:market_pair was implemented in the earlier #224 compliance merge (Ok(Json(vec![CmcOrderbookResponse { ... }])) in indexer/src/api/cmc.rs). This follow-up closes the #223 tracking gap: docs/invariants/skills cross-links, utoipa tag, and stricter integration tests.

What changed

  • Handler (unchanged behavior): 200 responses are [{ "timestamp", "bids", "asks" }] — exactly one element.
  • Tests (indexer/tests/api_cmc.rs): assert array root + len == 1 with LCD mock; 404 for unknown BASE_QUOTE does not return an array; CG /cg/orderbook stays a single object with ticker_id.
  • Docs: docs/CG_CMC_COMPLIANCE.md, docs/indexer-invariants.md (CMC shape row), gaps/GAP_1780023683.md.
  • Agent skills: skills/AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md, skills/AGENTS_TESTING_P2_EPIC.md.

Verification checklist (please confirm on staging/prod)

  • curl -s "$BASE/cmc/orderbook/LUNC_USTC" | jq 'type' → "array"
  • curl -s … | jq 'length' → 1
  • curl -s … | jq '.[0] | keys' includes timestamp, bids, asks (no ticker_id in array element — pair is path-only per Openware)
  • curl -s "$BASE/cmc/orderbook/LUNC_NOPE" → 404, body is not a JSON array
  • curl -s "$BASE/cg/orderbook?ticker_id=LUNC_USTC" | jq 'type' → "object" (CG unchanged)
  • cd indexer && cargo test --test api_cmc cmc_orderbook --test api_orderbook_lcd_mock cmc_orderbook -j 1 -- --test-threads=1 (Postgres dex_indexer_test required)

Leaving this issue open until listing QA signs off.

@brouie — could you run the checklist above on the deployed indexer and confirm CMC crawler compatibility?

## Resolution (shipped on `main` @ fdcc0c2) The **Openware Peatio array wrapper** for `GET /cmc/orderbook/:market_pair` was implemented in the earlier #224 compliance merge (`Ok(Json(vec![CmcOrderbookResponse { ... }]))` in `indexer/src/api/cmc.rs`). This follow-up closes the #223 tracking gap: docs/invariants/skills cross-links, utoipa tag, and stricter integration tests. ### What changed - **Handler (unchanged behavior):** 200 responses are `[{ "timestamp", "bids", "asks" }]` — exactly one element. - **Tests (`indexer/tests/api_cmc.rs`):** assert array root + `len == 1` with LCD mock; 404 for unknown `BASE_QUOTE` does not return an array; CG `/cg/orderbook` stays a single object with `ticker_id`. - **Docs:** `docs/CG_CMC_COMPLIANCE.md`, `docs/indexer-invariants.md` (CMC shape row), `gaps/GAP_1780023683.md`. - **Agent skills:** `skills/AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md`, `skills/AGENTS_TESTING_P2_EPIC.md`. ### Verification checklist (please confirm on staging/prod) - [ ] `curl -s "$BASE/cmc/orderbook/LUNC_USTC" | jq 'type'` → `"array"` - [ ] `curl -s … | jq 'length'` → `1` - [ ] `curl -s … | jq '.[0] | keys'` includes `timestamp`, `bids`, `asks` (no `ticker_id` in array element — pair is path-only per Openware) - [ ] `curl -s "$BASE/cmc/orderbook/LUNC_NOPE"` → **404**, body is **not** a JSON array - [ ] `curl -s "$BASE/cg/orderbook?ticker_id=LUNC_USTC" | jq 'type'` → `"object"` (CG unchanged) - [ ] `cd indexer && cargo test --test api_cmc cmc_orderbook --test api_orderbook_lcd_mock cmc_orderbook -j 1 -- --test-threads=1` (Postgres `dex_indexer_test` required) Leaving this issue **open** until listing QA signs off. @brouie — could you run the checklist above on the deployed indexer and confirm CMC crawler compatibility?
PlasticDigits commented 2026-05-30 06:29:55 +00:00 (Migrated from gitlab.com)

Verification pass (agent, worktree verify/issue-223, main @ 9f78dcd)

Independent re-check of GitLab #223 (CMC orderbook Openware array wrapper). No code changes required — behavior shipped in fdcc0c2 / #224 handler (Ok(Json(vec![CmcOrderbookResponse { ... }]))).

Technical criteria (issue body)

Criterion Result
200 response is JSON array length 1 PASS — live http://127.0.0.1:3001/cmc/orderbook/EMBER_CORAL → jq '{type, length}' → "array", 1
Element has timestamp, bids, asks PASS — keys exactly {timestamp,bids,asks}; timestamp int seconds; levels [price, quantity] strings
OpenAPI + compliance docs PASS — indexer/src/api/cmc.rs utoipa body = Vec<CmcOrderbookResponse>; docs/CG_CMC_COMPLIANCE.md, docs/indexer-invariants.md; skills AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md, AGENTS_TESTING_P2_EPIC.md
CG orderbook unchanged (object + ticker_id) PASS — live /cg/orderbook?ticker_id=EMBER_CORAL → type: object

Functional test plan

# Scenario Result
1 Valid market_pair PASS — 200, [{...}]
2 Invalid format (BADPAIR) PASS — 400, not array
3 Unknown pair (EMBER_FAKE) PASS — 404 text, not array
4 depth param PASS — obeys cap on live + cmc_orderbook_depth_capped_when_ok
  1. jq 'type' → "array" on live endpoint — PASS
  2. Openware structure diff — PASS (single-element array; no ticker_id inside element; pair path-only)
  3. CMC listing checklist signed off — NOT VERIFIED (requires listing QA / @brouie)

Tests

  • cargo test --test api_cmc -- --test-threads=1: 9/10 passed on this run (cg_orderbook_stays_object_not_array flaked 404 when dex_indexer_test was contended by parallel agents; re-run after quiet DB or use lock file).
  • Targeted #223 tests (cmc_orderbook_*, cmc_orderbook_200_with_lcd_mock) pass when DB seed is not truncated mid-suite.
  • First clean compile run: all four cmc_orderbook_* tests PASS.

Checklist for @brouie (staging/prod sign-off)

  • curl -s "$BASE/cmc/orderbook/<PAIR>" | jq 'type' → "array"
  • jq 'length' → 1
  • jq '.[0] | keys' → ["asks","bids","timestamp"] (order may vary)
  • Unknown pair → 404, body not a JSON array
  • curl -s "$BASE/cg/orderbook?ticker_id=<PAIR>" | jq 'type' → "object" with ticker_id
  • CMC crawler / listing checklist signed off

Status: Leaving open until verification criterion #3 and listing QA complete.

@brouie — please run the checklist on deployed indexer and confirm CMC crawler compatibility so we can close #223.

## Verification pass (agent, worktree `verify/issue-223`, `main` @ 9f78dcd) Independent re-check of GitLab **#223** (CMC orderbook Openware array wrapper). No code changes required — behavior shipped in **fdcc0c2** / #224 handler (`Ok(Json(vec![CmcOrderbookResponse { ... }]))`). ### Technical criteria (issue body) | Criterion | Result | |-----------|--------| | 200 response is JSON **array** length **1** | **PASS** — live `http://127.0.0.1:3001/cmc/orderbook/EMBER_CORAL` → `jq '{type, length}'` → `"array"`, `1` | | Element has `timestamp`, `bids`, `asks` | **PASS** — keys exactly `{timestamp,bids,asks}`; `timestamp` int seconds; levels `[price, quantity]` strings | | OpenAPI + compliance docs | **PASS** — `indexer/src/api/cmc.rs` utoipa `body = Vec<CmcOrderbookResponse>`; `docs/CG_CMC_COMPLIANCE.md`, `docs/indexer-invariants.md`; skills `AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md`, `AGENTS_TESTING_P2_EPIC.md` | | CG orderbook unchanged (object + `ticker_id`) | **PASS** — live `/cg/orderbook?ticker_id=EMBER_CORAL` → `type: object` | ### Functional test plan | # | Scenario | Result | |---|----------|--------| | 1 | Valid `market_pair` | **PASS** — 200, `[{...}]` | | 2 | Invalid format (`BADPAIR`) | **PASS** — 400, not array | | 3 | Unknown pair (`EMBER_FAKE`) | **PASS** — 404 text, not array | | 4 | `depth` param | **PASS** — obeys cap on live + `cmc_orderbook_depth_capped_when_ok` | ### Verification criteria (issue footer) 1. `jq 'type'` → `"array"` on live endpoint — **PASS** 2. Openware structure diff — **PASS** (single-element array; no `ticker_id` inside element; pair path-only) 3. **CMC listing checklist signed off** — **NOT VERIFIED** (requires listing QA / @brouie) ### Tests - `cargo test --test api_cmc -- --test-threads=1`: **9/10 passed** on this run (`cg_orderbook_stays_object_not_array` flaked 404 when `dex_indexer_test` was contended by parallel agents; re-run after quiet DB or use lock file). - Targeted #223 tests (`cmc_orderbook_*`, `cmc_orderbook_200_with_lcd_mock`) pass when DB seed is not truncated mid-suite. - First clean compile run: all four `cmc_orderbook_*` tests **PASS**. ### Checklist for @brouie (staging/prod sign-off) - [ ] `curl -s "$BASE/cmc/orderbook/<PAIR>" | jq 'type'` → `"array"` - [ ] `jq 'length'` → `1` - [ ] `jq '.[0] | keys'` → `["asks","bids","timestamp"]` (order may vary) - [ ] Unknown pair → **404**, body **not** a JSON array - [ ] `curl -s "$BASE/cg/orderbook?ticker_id=<PAIR>" | jq 'type'` → `"object"` with `ticker_id` - [ ] CMC crawler / listing checklist signed off **Status:** Leaving **open** until verification criterion **#3** and listing QA complete. @brouie — please run the checklist on deployed indexer and confirm CMC crawler compatibility so we can close #223.
PlasticDigits commented 2026-05-30 06:32:31 +00:00 (Migrated from gitlab.com)

mentioned in issue #224

mentioned in issue #224
PlasticDigits commented 2026-05-30 09:13:01 +00:00 (Migrated from gitlab.com)

Does not require manual qa, agent can conduct these items

Does not require manual qa, agent can conduct these items
PlasticDigits commented 2026-05-30 12:23:35 +00:00 (Migrated from gitlab.com)

Verification pass (agent, worktree verify/issue-223, main @ 3e7a175)

Independent re-check of GitLab #223 (CMC orderbook Openware top-level array wrapper). No code changes required — behavior already shipped in fdcc0c2 / #224 (Ok(Json(vec![CmcOrderbookResponse { ... }])) in indexer/src/api/cmc.rs).

Infra health (pre-check)

  • Docker: localterra + postgres healthy
  • Indexer: GET http://127.0.0.1:3001/health → {"status":"ok"}
  • LocalTerra RPC: OK via scripts/lib/localterra-host-curl.sh exec fallback

Acceptance criteria (issue body)

Criterion Result
200 response is JSON array length 1 PASS — live GET /cmc/orderbook/EMBER_CORAL → jq '{type,length}' → "array", 1
Element has timestamp, bids, asks PASS — keys exactly {timestamp,bids,asks}; timestamp JSON number (seconds); levels [price, quantity] strings
OpenAPI + compliance docs PASS — indexer/src/api/cmc.rs utoipa body = Vec<CmcOrderbookResponse>; docs/CG_CMC_COMPLIANCE.md § GET /cmc/orderbook; docs/indexer-invariants.md CMC shape row; skills AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md, AGENTS_TESTING_P2_EPIC.md
CG orderbook unchanged (object + ticker_id) PASS — live /cg/orderbook?ticker_id=EMBER_CORAL → type: object, has ticker_id

Functional test plan

# Scenario Result
1 Valid market_pair PASS — 200, [{...}]
2 Invalid format (BADPAIR) PASS — 400, not array
3 Unknown pair (EMBER_FAKE, LUNC_NOPE) PASS — 404 text, not array
4 depth param PASS — depth=9999 → 50 bids + 50 asks (cap 100 total)
  1. jq 'type' → "array" on live endpoint — PASS
  2. Openware structure diff — PASS (top-level [{ timestamp, bids, asks }]; pair path-only; intentional delta: timestamp seconds not ms per #222/#224 docs)
  3. CMC listing checklist signed off — NOT VERIFIED (requires listing QA)

Automated tests (#223 scope, serial)

cargo test --test api_cmc 'cmc_orderbook' -- --test-threads=1   → 4/4 pass
cargo test --test api_cmc cg_orderbook_stays_object_not_array -- --test-threads=1 → pass
cargo test --test api_orderbook_lcd_mock 'cmc_orderbook' -- --test-threads=1 → 2/2 pass

Note: full api_cmc suite can flake on cmc_summary_returns_200 when dex_indexer_test is contended by parallel agents; #223 tests pass in isolation.

Manual verification checklist (staging/prod)

  • curl -s "$BASE/cmc/orderbook/LUNC_USTC" | jq 'type' → "array"
  • curl -s … | jq 'length' → 1
  • curl -s … | jq '.[0] | keys' → ["asks","bids","timestamp"] (no ticker_id in element)
  • curl -s "$BASE/cmc/orderbook/LUNC_NOPE" → 404, body not a JSON array
  • curl -s "$BASE/cg/orderbook?ticker_id=LUNC_USTC" | jq 'type' → "object"
  • cd indexer && cargo test --test api_cmc 'cmc_orderbook' --test api_orderbook_lcd_mock 'cmc_orderbook' -- --test-threads=1

Leaving open — all technical criteria pass locally; item 3 (CMC listing sign-off) remains outstanding.

@brouie — please run the checklist above on the deployed indexer and confirm CMC crawler compatibility so we can close #223.

## Verification pass (agent, worktree `verify/issue-223`, `main` @ 3e7a175) Independent re-check of GitLab **#223** (CMC orderbook Openware top-level array wrapper). **No code changes required** — behavior already shipped in `fdcc0c2` / #224 (`Ok(Json(vec![CmcOrderbookResponse { ... }]))` in `indexer/src/api/cmc.rs`). ### Infra health (pre-check) - Docker: `localterra` + `postgres` **healthy** - Indexer: `GET http://127.0.0.1:3001/health` → `{"status":"ok"}` - LocalTerra RPC: OK via `scripts/lib/localterra-host-curl.sh` exec fallback ### Acceptance criteria (issue body) | Criterion | Result | |-----------|--------| | 200 response is JSON **array** length **1** | **PASS** — live `GET /cmc/orderbook/EMBER_CORAL` → `jq '{type,length}'` → `"array"`, `1` | | Element has `timestamp`, `bids`, `asks` | **PASS** — keys exactly `{timestamp,bids,asks}`; `timestamp` JSON number (seconds); levels `[price, quantity]` strings | | OpenAPI + compliance docs | **PASS** — `indexer/src/api/cmc.rs` utoipa `body = Vec<CmcOrderbookResponse>`; `docs/CG_CMC_COMPLIANCE.md` § `GET /cmc/orderbook`; `docs/indexer-invariants.md` CMC shape row; skills `AGENTS_INDEXER_AMM_ORDERBOOK_SIM.md`, `AGENTS_TESTING_P2_EPIC.md` | | CG orderbook unchanged (object + `ticker_id`) | **PASS** — live `/cg/orderbook?ticker_id=EMBER_CORAL` → `type: object`, has `ticker_id` | ### Functional test plan | # | Scenario | Result | |---|----------|--------| | 1 | Valid `market_pair` | **PASS** — 200, `[{...}]` | | 2 | Invalid format (`BADPAIR`) | **PASS** — 400, not array | | 3 | Unknown pair (`EMBER_FAKE`, `LUNC_NOPE`) | **PASS** — 404 text, not array | | 4 | `depth` param | **PASS** — `depth=9999` → 50 bids + 50 asks (cap 100 total) | ### Verification criteria (issue footer) 1. `jq 'type'` → `"array"` on live endpoint — **PASS** 2. Openware structure diff — **PASS** (top-level `[{ timestamp, bids, asks }]`; pair path-only; intentional delta: `timestamp` seconds not ms per #222/#224 docs) 3. **CMC listing checklist signed off** — **NOT VERIFIED** (requires listing QA) ### Automated tests (#223 scope, serial) ``` cargo test --test api_cmc 'cmc_orderbook' -- --test-threads=1 → 4/4 pass cargo test --test api_cmc cg_orderbook_stays_object_not_array -- --test-threads=1 → pass cargo test --test api_orderbook_lcd_mock 'cmc_orderbook' -- --test-threads=1 → 2/2 pass ``` Note: full `api_cmc` suite can flake on `cmc_summary_returns_200` when `dex_indexer_test` is contended by parallel agents; #223 tests pass in isolation. ### Manual verification checklist (staging/prod) - [ ] `curl -s "$BASE/cmc/orderbook/LUNC_USTC" | jq 'type'` → `"array"` - [ ] `curl -s … | jq 'length'` → `1` - [ ] `curl -s … | jq '.[0] | keys'` → `["asks","bids","timestamp"]` (no `ticker_id` in element) - [ ] `curl -s "$BASE/cmc/orderbook/LUNC_NOPE"` → **404**, body **not** a JSON array - [ ] `curl -s "$BASE/cg/orderbook?ticker_id=LUNC_USTC" | jq 'type'` → `"object"` - [ ] `cd indexer && cargo test --test api_cmc 'cmc_orderbook' --test api_orderbook_lcd_mock 'cmc_orderbook' -- --test-threads=1` **Leaving open** — all technical criteria pass locally; item 3 (CMC listing sign-off) remains outstanding. @brouie — please run the checklist above on the deployed indexer and confirm CMC crawler compatibility so we can close #223.
PlasticDigits commented 2026-05-30 12:25:20 +00:00 (Migrated from gitlab.com)

Full compliance verification checklist — PASS (local indexer)

Per user approval, local verification is sufficient to close #223. Base: http://127.0.0.1:3001, sample pair EMBER_CORAL.

# Check Result
1 /cg/pairs keys → ticker_id, base, target, pool_id PASS
2 /cg/tickers consolidated volumes + cl8y_extensions when hybrid PASS — 25/25 tickers have cl8y_extensions; base_volume/target_volume present
3 /cg/orderbook — timestamp number ~ms; bids ↓ asks ↑ PASS — timestamp=1780143899731; sort checks pass
4 /cg/historical_trades — trade_timestamp seconds PASS — buy/sell object shape; sample trade_timestamp=1780143899 (number, ~1e9)
5 /cmc/summary — array, Openware field names PASS — 25 rows; keys include trading_pairs, base_currency, quote_currency, volumes, 24h stats
6 /cmc/orderbook/:pair — array len 1; ts seconds; depth cap 100 PASS — type=array, length=1, ts seconds; depth=9999 → 50+50 ≤ 100 (#223)
7 /cmc/trades/:pair — array; timestamp seconds PASS — 13 trades; timestamp number ~1e9
8 Not Pro API v3 — /cg + /cmc only PASS — /cg/pairs & /cmc/summary → 200; /api/v3/ping → 404
9 Simulated book disclosure (hybrid-sim vs limit-book) PASS — documented in docs/integrators.md, docs/CG_CMC_COMPLIANCE.md, docs/limit-orders.md
10 CI tests PASS — cargo test --test api_orderbook_lcd_mock --test api_cg --test api_cmc -- --test-threads=1 → 29/29

Issue #223 acceptance criteria (recap)

  • CMC orderbook 200 → JSON array length 1 with {timestamp,bids,asks}
  • OpenAPI + compliance docs aligned
  • CG orderbook remains single object with ticker_id
  • Full listing compliance checklist signed off (local pass)

Closing #223 — Openware CMC orderbook array wrapper verified end-to-end.

## Full compliance verification checklist — **PASS** (local indexer) Per user approval, local verification is sufficient to close **#223**. Base: `http://127.0.0.1:3001`, sample pair `EMBER_CORAL`. | # | Check | Result | |---|--------|--------| | 1 | `/cg/pairs` keys → `ticker_id`, `base`, `target`, `pool_id` | **PASS** | | 2 | `/cg/tickers` consolidated volumes + `cl8y_extensions` when hybrid | **PASS** — 25/25 tickers have `cl8y_extensions`; `base_volume`/`target_volume` present | | 3 | `/cg/orderbook` — `timestamp` number ~ms; bids ↓ asks ↑ | **PASS** — `timestamp=1780143899731`; sort checks pass | | 4 | `/cg/historical_trades` — `trade_timestamp` seconds | **PASS** — `buy`/`sell` object shape; sample `trade_timestamp=1780143899` (number, ~1e9) | | 5 | `/cmc/summary` — array, Openware field names | **PASS** — 25 rows; keys include `trading_pairs`, `base_currency`, `quote_currency`, volumes, 24h stats | | 6 | `/cmc/orderbook/:pair` — array len 1; ts seconds; depth cap 100 | **PASS** — `type=array`, `length=1`, ts seconds; `depth=9999` → 50+50 ≤ 100 (**#223**) | | 7 | `/cmc/trades/:pair` — array; `timestamp` seconds | **PASS** — 13 trades; `timestamp` number ~1e9 | | 8 | Not Pro API v3 — `/cg` + `/cmc` only | **PASS** — `/cg/pairs` & `/cmc/summary` → 200; `/api/v3/ping` → 404 | | 9 | Simulated book disclosure (hybrid-sim vs `limit-book`) | **PASS** — documented in `docs/integrators.md`, `docs/CG_CMC_COMPLIANCE.md`, `docs/limit-orders.md` | | 10 | CI tests | **PASS** — `cargo test --test api_orderbook_lcd_mock --test api_cg --test api_cmc -- --test-threads=1` → **29/29** | ### Issue #223 acceptance criteria (recap) - [x] CMC orderbook 200 → JSON array length 1 with `{timestamp,bids,asks}` - [x] OpenAPI + compliance docs aligned - [x] CG orderbook remains single object with `ticker_id` - [x] Full listing compliance checklist signed off (local pass) Closing **#223** — Openware CMC orderbook array wrapper verified end-to-end.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-30 12:25:25 +00:00
PlasticDigits commented 2026-05-30 12:33:39 +00:00 (Migrated from gitlab.com)

mentioned in commit 8c69546d8c

mentioned in commit 8c69546d8c178a739887079db903eb29c938c396
PlasticDigits commented 2026-06-07 12:14:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#223
No description provided.