feat(indexer): bot-grade book snapshots, discovery, streams and keyed read budgets #1580

Open
opened 2026-10-29 00:31:25 +00:00 by PlasticDigits · 1 comment
Owner

Summary

External trading bots (market makers, cross-venue arbitrage, Hummingbot-class connectors) need a read surface that is cheap for the indexer, honest about freshness, and stable enough to build a maintained connector against. Today the only bot-usable book endpoints proxy on-chain LCD walks: each page costs 1 + N smart queries, they are capped at RATE_LIMIT_LCD_HEAVY_RPS (10 rps per socket peer IP in production), and they cannot supply the ≥100-level depth or push streams that the Hummingbot spot-connector standard expects.

The indexer already maintains an LCD-free mirror of pool reserves and the resting limit book for the route solver, but that mirror is not exposed to anyone. This issue bundles the DEX-side read plane for bots:

  1. cached L2 book snapshots served from the existing mirror,
  2. one-call market / trading-rules / venue-manifest discovery,
  3. public book streaming and a per-wallet order/fill stream,
  4. read-only keyed budgets so bot traffic is attributable and cannot starve retail traffic.

It is a prerequisite for the two connector issues it will be cross-linked with, and it changes no contract behavior, quote math, or existing endpoint contract.

Community request (anonymized)

A community request asked whether a Hummingbot connector is worth building for CL8Y DEX, reasoning that strategy/bot flow already reaches major centralized venues, that bots only need a discoverable, tradable and profitable market, and that this would widen reach without a marketing programme.

This issue covers only the DEX read surface those connectors need. Do not retain or reproduce handles, timestamps, quotations, or any user-identifying information from that request in this issue, code, docs, tests or fixtures.

Current codebase

Routes and rate layers

  • indexer/src/api/mod.rs wires the LCD-heavy router: order-book-head, limit-book-shallow, limit-book, limit-book/insert-hints, route/solve, route/solve/best, route/solve/progress, compliance/blacklist-check, cg/orderbook, cmc/orderbook/*. It applies require_quote_chain (chain-attestation gate) and apply_rate_limit_layer(.., config.rate_limit_lcd_heavy_rps).
  • indexer/src/config.rs: RUN_MODE=prod forces RATE_LIMIT_RPS=60 and RATE_LIMIT_LCD_HEAVY_RPS=10 when unset/zero (prod_forces_nonzero_rate_limits_when_zero). Dev dual-zero is refused on a non-loopback bind unless ALLOW_ZERO_RATE_LIMITS=1.
  • indexer/src/security.rs keys the governor on the socket peer IP (PeerIpKeyExtractor); no X-Forwarded-For / CF-Connecting-IP trust. Listener is IPv4-only by default (API_IPV6_ENABLED).
  • 429 responses carry Retry-After + x-ratelimit-*; quote paths add Cache-Control: no-store via indexer/src/api/quote_cache_control.rs.

LCD-proxy book (expensive, paginated)

  • GET /api/v1/pairs/{addr}/limit-book?side=&limit=&after_order_id= — default 50, max 100 rows, one page ≈ 1 + N LCD smart queries.
  • GET /api/v1/pairs/{addr}/order-book-head, .../limit-book-shallow (default 10, max 20), .../limit-book/insert-hints (≤100 prices, one walk).
  • Documented in docs/limit-orders.md § Indexer limit book (LCD proxy) and docs/integrators.md.

LCD-free mirror (exists, unexposed)

  • indexer/src/indexer/book_snapshot.rs runs every BOOK_SNAPSHOT_INTERVAL_MS (10 000 ms) and upserts:
    • resting_limit_orders (order_id, side, price, remaining, owner, expires_at, block_height, snapshot_at, walk_index) — wholesale replace per pair, walk_index preserves on-chain FIFO after UpdateLimitOrderPrice (L23 / #1227).
    • pair_reserves / hybrid_pair_reserves (reserve_0, reserve_1, fee_bps with -1 = unobserved, block_height, snapshot_at) — independent generations since #1453.
  • Freshness constants: BOOK_SNAPSHOT_STALENESS_TOLERANCE_CYCLES = 2, BOOK_SNAPSHOT_MAX_STALENESS_MS = 20_000; AppState.book_snapshot_max_staleness_ms.
  • Consumers: indexer/src/api/db_orderbook_sim.rs (MirrorLoadMeta { db_hybrid_queries, lcd_fallback_queries, mirror_stale_hops, mirror_missing_hops, max_snapshot_age_ms }) and the solver only. No HTTP route exposes the mirror.

Bot-shaped reads that already exist (DB-backed)

  • GET /api/v1/pairs, /{addr}, /{addr}/stats, /{addr}/trades
  • GET /api/v1/pairs/{addr}/limit-placements|limit-cancellations|limit-fills, /{addr}/limit-orders/{order_id}/fills
  • GET /api/v1/traders/{addr}/limit-placements|limit-cancellations|limit-fills|trades|positions
  • GET /api/v1/tokens, /{addr}, /{addr}/pairs
  • GET /api/v1/route/solve — already zero-LCD (local_v1), returns hops, router_operations, estimated_amount_out_net, optimality_scope, snapshot_age_ms, snapshot_block_height, quote_kind.
  • GET /api/v1/health, /ready, /ready-api, GET /api/v1/health/fee-discount.

Missing pieces (the gap)

  • No cached book/depth endpoint; no per-market trading rules (tick/price band, min remainder, rung/step caps, paused/blacklist/frozen); discovery requires several calls and omits decimals.
  • No streaming transport of any kind: indexer/Cargo.toml has no WebSocket/SSE dependency.
  • No API keys / keyed budgets; one bot behind one egress IP shares the 10 rps LCD-heavy budget with retail.
  • No venue manifest (chain-id, factory/router/fee-discount addresses, gas floor) so every client hardcodes deployment constants.
  • No documented freshness contract for external consumers (only internal snapshot_age_ms).

Why

  • A market maker on five pairs refreshing every second would issue ~5 limit-book calls/s, each costing 1 + depth LCD queries, against a 10 rps per-IP cap. That is both an LCD-amplification risk and a guaranteed 429 for legitimate bots (and for retail behind the same NAT).
  • Hummingbot's spot-connector standard requires an order book channel of minimum depth 100 plus a private user order/trade channel; the current API cannot satisfy either.
  • Discoverability is a product feature: if a bot cannot read rules (tick/band/min-size/fees/pause) and a fresh book in a few calls, it will not trade here regardless of profitability.
  • Bot traffic is currently unattributable: abuse and accidental loops look identical to retail, and there is no way to grant a known integrator a bounded, revocable budget.
  • The mirror already exists and is already trusted by the solver; exposing it costs no additional LCD work.

Constraints and guardrails

  1. Zero LCD in the request path. New snapshot/markets/stream endpoints must serve exclusively from Postgres mirrors. Anonymous and keyed reads must not add lcd_* queries. Enforce with a test that asserts an LCD mock receives zero calls on these routes.
  2. Honest freshness. Every snapshot carries snapshot_at, age_ms, block_height, stale and source. Unknown ≠ empty: a missing/stale reserves row must be distinguishable from "no resting orders". A stale: true snapshot is advisory only and must never be presented as tradeable depth.
  3. Depth is raw and post-fee. remaining is the on-chain post-maker-fee escrow; price is raw token1-per-token0 (Decimal atomics). Document the basis and decimals next to the field. Do not humanise, invert, or compute USD in this endpoint.
  4. No identity expansion. owner is already public on-chain; do not add trader tiers, balances, IPs, or any other actor data. No hashing scheme that pretends to anonymise a public chain address.
  5. Additive and backwards compatible. Keep limit-book* contracts, caps and rate buckets unchanged. Migrations must be additive and indexed; no new required env var (defaults only); Coolify single-container deploy must keep working.
  6. Read-only auth. Keys/streams grant no write, custody, or chain access. Keys are hashed at rest, revocable, scoped to read routes, never accepted in a URL, and never logged.
  7. Bounded fanout. Per-connection depth cap, per-key and per-IP connection caps, message-rate cap, heartbeat, slow-consumer disconnect, bounded memory, reconnect backoff.
  8. Cache semantics. Dynamic bot endpoints send Cache-Control: no-store (they are chain state, not static). ETag/304 is allowed only when derived from a server-computed generation (snapshot_at + block_height) — never from a client-supplied value.
  9. Rate-limit keying stays socket-peer IP for anonymous traffic. Do not add a spoofable XFF extractor. If keys are added, they add budget for that key only and cannot raise anonymous or per-IP limits.
  10. Privacy and process. No chat excerpts, handles or operator identities in code, docs, fixtures, metrics labels or logs. Unavailable live checks are explicit SKIP; executed failures remain FAIL.
  11. Production posture. RUN_MODE=prod forced limits remain; no new public unauthenticated mutation surface; /metrics is still not exposed (observability is tracing per #200).

Relevant files

Area Files
Routes / state / limits indexer/src/api/mod.rs, indexer/src/config.rs, indexer/src/security.rs, indexer/src/startup.rs
Mirror + queries indexer/src/indexer/book_snapshot.rs, indexer/src/db/queries/resting_orders.rs, indexer/src/db/queries/pair_reserves.rs, indexer/src/api/db_orderbook_sim.rs
Pairs / tokens / fills indexer/src/api/pairs.rs, indexer/src/api/tokens.rs, indexer/src/api/traders.rs, indexer/src/db/queries/limit_order_fills.rs
Attestation / cache indexer/src/api/quote_cache_control.rs, docs/runbooks/chain-attestation.md
Migrations indexer/migrations/
Docs docs/indexer-http.md, docs/indexer-invariants.md, docs/limit-orders.md, docs/integrators.md, docs/runbooks/book-snapshot-mirror.md, OpenAPI annotations in api/*.rs
Contract truth (reference only) smartcontracts/packages/dex-common/src/pair.rs, smartcontracts/packages/dex-common/src/limit_placement.rs
Tests indexer/tests/api_limit_book_deep.rs, indexer/tests/book_snapshot_loop.rs, indexer/tests/db_orderbook_mirror.rs, indexer/tests/api_route_solve.rs

Recommended direction

Phase 1 — cached L2 snapshot

GET /api/v1/pairs/{addr}/book/snapshot?depth_bids=100&depth_asks=100

{
  "pair": "terra1…",
  "token_0": "terra1…", "token_1": "terra1…",
  "token_0_decimals": 6, "token_1_decimals": 6,
  "price_basis": "raw token1 per token0 (Decimal atomics)",
  "fee_bps": 180, "fee_bps_observed": true,
  "reserves": { "reserve_0": "…", "reserve_1": "…" },
  "bids": [{ "order_id": 41, "price": "…", "remaining": "…", "owner": "terra1…", "expires_at": null, "walk_index": 0 }],
  "asks": [{ "order_id": 57, "price": "…", "remaining": "…", "owner": "terra1…", "expires_at": 1760000000, "walk_index": 0 }],
  "snapshot_at": "2026-10-20T00:00:00Z", "age_ms": 4100, "block_height": 123456,
  "stale": false, "depth_truncated": false
}
  • Depth defaults 100, hard cap configurable (e.g. 500 per side) with depth_truncated rather than silent truncation.
  • 404 unknown pair, 400 invalid depth/side, 503 only when the mirror row is absent and a documented freshness policy says so; otherwise return stale: true with the last good snapshot.
  • ETag from (snapshot_at, block_height, depth); support If-None-Match → 304.

Phase 2 — venue manifest + discovery (one call)

GET /api/v1/markets (paginated, stable sort by pair id):

  • chain_id (columbus-5), gas_price_uluna (28.325), router, factory, fee_discount_registry, treasury — from indexer config/env, never hardcoded in clients.
  • per market: pair, base/quote token address, symbol, decimals, fee_bps, effective_fee_note, price_band_min/max (human 1e-9…1e9), min_place_remaining_raw (10), max_batch_rungs (pair query, cached from indexer), max_adjust_steps_cap (256), max_maker_fills_cap (100), paused, blacklisted, code_id_frozen, hook_addresses, indexed_at, snapshot_at.
  • Discovery must not fabricate flags it cannot read; unknown = null with a reason string, never false.

Phase 3 — streaming

  • GET /api/v1/stream/book?pairs=<csv>&depth=100 (SSE first; a WebSocket wrapper is optional if upstream review requires it). Events: snapshot (initial), update (pair, generation, block height, changed levels), heartbeat. id: = monotonic generation for Last-Event-ID resume within a bounded replay window; gap beyond the window → new snapshot and a client-visible resync flag.
  • POST /api/v1/auth/challenge → short-lived nonce; POST /api/v1/auth/verify with a canonical, domain-separated signed message (chain-id + host + nonce + expiry) → short-lived read token.
  • GET /api/v1/stream/trader/{addr} with that token: order placements, fills, cancellations, parks (reason), claims — only for the authenticated address. Anonymous access to this stream is refused (public chain history remains available through existing REST).

Phase 4 — keyed budgets

  • X-API-Key (hashed at rest) mapped to {rps, burst, max_streams, depth_cap}; admin-managed outside the request path (env file or SQL, operator-run script; no HTTP admin route in this issue).
  • 429 remains authoritative with Retry-After; keys never bypass per-IP anonymous caps. Document anonymous caps as the default contract.

Phase 5 — contract, docs, verification

  • Freeze a versioned response contract (schema_version), document freshness/stale semantics, publish it in docs/indexer-http.md, add OpenAPI (utoipa), add a skills/AGENTS_BOT_MARKET_DATA.md playbook with invariants, a docs/qa/issue-<n>/README.md checklist, and make verify-issue-<n>.

Given / When / Then

Given the indexer mirror is fresh for pair P and the LCD is unreachable,

When a bot calls GET /api/v1/pairs/P/book/snapshot?depth_bids=100 and GET /api/v1/markets,

Then both answers come from Postgres with zero LCD queries, carry snapshot_at/age_ms/block_height/stale, and the depth ordering matches on-chain FIFO (walk_index, not order_id).

Given the mirror is older than the configured staleness budget,

When the bot requests the snapshot or a book stream,

Then the response is explicitly stale: true (REST) or emits resync (stream) and never presents the data as current, and the bot-side guard can refuse to trade.

Given a market is paused, blacklisted, or its code id is frozen,

When the bot reads /api/v1/markets,

Then the flag is present and truthful, and an unreadable flag is null with a reason rather than a false false.

Acceptance criteria

  1. GET /api/v1/pairs/{addr}/book/snapshot serves bids/asks from resting_limit_orders in walk_index order, includes reserves/fee/freshness, honours depth caps, and performs zero LCD queries (asserted by test).
  2. Missing reserves vs empty book vs stale snapshot are three distinguishable states; stale is set from BOOK_SNAPSHOT_MAX_STALENESS_MS (boundary tested on both sides).
  3. ETag/304 works and cannot be forced by client input; Cache-Control: no-store is set on all new dynamic routes.
  4. GET /api/v1/markets returns chain/venue manifest plus per-market decimals, fee, price band, min remainder, rung/step/maker-fill caps, paused/blacklist/frozen flags, and snapshot_at; pagination is stable and bounded.
  5. GET /api/v1/stream/book delivers initial depth ≥100 per pair, ordered updates with generation/height, heartbeat, Last-Event-ID resume, and an explicit resync when resume is impossible.
  6. POST /api/v1/auth/challenge + verify yields a short-lived read token; signature is domain-separated (chain-id + host + nonce + expiry), single-use, replay-rejected; a token only authorises its own address.
  7. GET /api/v1/stream/trader/{addr} delivers placements/fills/cancels/parks/claims for that address only, with no cross-address leakage, and refuses unauthenticated access.
  8. Keyed budgets: a valid key raises only its own budget; invalid/revoked/absent keys fall back to anonymous caps; 429 includes Retry-After; no key value appears in logs, traces, errors, or URLs.
  9. Connection/fanout caps hold: N+1 streams are refused predictably, a slow consumer is disconnected, and memory stays flat over a 10-minute soak.
  10. Existing endpoints (limit-book*, route/solve*, /pairs, /traders/*) are byte-compatible and keep their rate buckets; regression suites pass unchanged.
  11. OpenAPI documents every new route, and docs/indexer-http.md + docs/integrators.md describe freshness, caps, and the mirror-vs-LCD distinction.
  12. make verify-issue-<n> exists and passes; docs/qa/issue-<n>/README.md checklist and skills/AGENTS_BOT_MARKET_DATA.md are present with invariants MD1–MD10.
  13. No secrets, chat text, handles or user identifiers appear in code, docs, fixtures, logs or metrics labels.

Test plan — all paths

# Path Case Expected
T1 Unit Snapshot maps mirror rows in walk_index order, bids/asks separated Ordering equals fixture walk
T2 Unit depth=0, negative, float, exponent, string, huge (1e9) 400 for invalid; clamp + depth_truncated for oversize; never allocate unbounded
T3 Unit Unknown pair, pair without reserves row, empty book 404 / reserves: null + stale semantics / `bids
T4 Unit fee_bps = -1 (unobserved) fee_bps_observed: false, never 0
T5 Integration (Postgres) Mirror populated, LCD mock counting Snapshot == rows; lcd_calls == 0
T6 Integration Staleness at 19.9 s and 20.1 s stale:false then stale:true
T7 Integration Mirror row updated between two calls ETag changes; If-None-Match old value → 200 with new body, current value → 304
T8 Integration /markets with paused, blacklisted, frozen, listing-excluded, missing-metadata pairs Truthful flags/null + reason; excluded pairs follow existing policy
T9 Integration /markets pagination at boundaries (first, last, beyond end) Stable, no duplicates, documented empty page
T10 Stream Two pairs × depth 100 initial + update ordering Sequence monotonic, per-pair isolation, correct walk_index order
T11 Stream Last-Event-ID within window / beyond window / unknown id Replay / resync + fresh snapshot / resync
T12 Stream Heartbeat and idle timeout; half-open TCP Heartbeat observed; dead peer reaped within bound
T13 Stream Slow consumer exceeding buffer Disconnected with a typed reason; other streams unaffected
T14 Auth Valid signature Token issued, scoped to address, expires
T15 Auth Wrong signature, wrong chain-id, wrong host, expired nonce, reused nonce, wrong bech32 prefix, mixed case 401/403 with reason; no token; no state change
T16 Auth Token used for another address stream 403; no rows
T17 Budget Anonymous at cap; keyed below/above cap; revoked key; malformed key 429 with Retry-After; keyed budget honoured; revoked → anonymous caps
T18 Budget Burst then sustained Token-bucket behaviour matches configured rps/burst
T19 Load 50 keys × 5 rps snapshot for 10 min p95 latency within budget, flat RSS, zero LCD calls, no 5xx
T20 Regression limit-book*, route/solve*, /pairs, /traders/* Unchanged responses and rate buckets
T21 Ops RUN_MODE=prod, missing optional env Starts with documented defaults; forced limits intact
T22 Deploy Coolify single-container, migrations on boot Migrations additive, idempotent, no downtime requirement

Adversarial test plan — attack, hack, abuse

# Vector Attack Required behaviour
A1 LCD amplification Flood snapshot/stream endpoints to drive chain load Zero LCD fan-out by construction; assert counter stays 0
A2 Parameter amplification depth=999999999, deep pagination, comma-bomb pairs=, duplicate pairs Bounded parse + hard caps + 400/depth_truncated; no OOM
A3 Rate-limit bypass Spoofed X-Forwarded-For/CF-Connecting-IP, rotating IPv6, key header guessing Peer-IP keying retained; keys not guessable (high-entropy, hashed, timing-safe compare); no bypass
A4 Auth replay / cross-chain replay Replay a valid signed challenge on another host/chain, or twice on the same host Domain separation + single-use nonce store + short expiry; rejected
A5 Stream eavesdropping Subscribe to another trader's stream, tamper with path/param Refuse unless the token's address matches; no rows leaked; timing does not reveal existence
A6 Fake freshness Forge If-None-Match, Last-Event-ID, or clock-skew to pin stale data as fresh Generation is server-computed; forged ids → resync; client clocks never trusted
A7 Cache poisoning Shared proxy caches a snapshot across keys/traders no-store on dynamic/private routes; Vary where relevant; private stream never cacheable
A8 Connection exhaustion Open/reopen thousands of streams from one peer Per-IP and per-key connection caps, handshake budget, reconnect backoff, predictable 429/close code
A9 Slowloris / half-open Hold sockets without reading Idle/heartbeat timeout and write-buffer disconnect
A10 Data poisoning Tamper with indexer DB mirror rows and read them back as "current" Staleness/height monotonicity guards; no write path via HTTP; operator-only DB access documented
A11 Key leakage Search logs, errors, URLs, metrics for keys/tokens Redaction test: secrets never rendered; auth failures log reason + address only
A12 Enumeration / surveillance Enumerate all traders via stream or markets Only public on-chain order data exposed (already public); no added aggregation of actor behaviour
A13 Abuse of "stale" Client ignores stale and trades on frozen depth Server-side contract clear; connector issue must fail closed (cross-linked)
A14 Supply chain Malicious SSE/WS dependency Prefer std/axum-native streaming; no new native deps without review (see docs/supply-chain-security.md)

Verification criteria

  • make verify-issue-<n> runs: cargo fmt --check, cargo clippy -- -D warnings, unit tests, Postgres integration tests (T5–T9, T14–T18), stream/auth tests (T10–T13), the zero-LCD assertion (T5/A1), OpenAPI/documentation link checks, and a schema contract diff.
  • make test-indexer-integration (or the subset documented in the checklist) passes with a disposable DB per docs/runbooks/indexer-database-isolation.md.
  • docs/qa/issue-<n>/README.md records each acceptance criterion as PASS / FAIL / SKIP with the exact command and result. Unavailable live checks are explicit SKIP and do not close acceptance; executed failures stay FAIL.
  • Read-only production receipts (no wallet, no mutation): curl -s https://indexer.dex.cl8y.com/api/v1/markets | jq …, snapshot curl for one pair, one SSE capture with --max-time, with UTC timestamps and the served git SHA (/health git_sha).
  • A short soak receipt: 10-minute load with p95, error count, RSS, and lcd_calls == 0.
  • Restart/deploy receipt: additive migration applies on an existing DB copy; /ready and /ready-api still truthful.
  • Source-only checks are explicitly not proof of deployment acceptance.

Out of scope

  • Any order placement, signing, custody, or key management (connector issues).
  • Changes to quote math, route ranking, solver bounds, fee logic, or contract messages.
  • A global exchange-grade ticker/trade WebSocket for listing sites (CG/CMC/GeckoTerminal have their own adapters).
  • CL8Y Bridge / cross-chain settlement. This read plane does not serve bridge state; bridge-backed cross-chain arbitrage and inventory rebalancing are scoped in #1582, which consumes the deployed bridge (https://bridge.cl8y.com).
  • Marketing, listings, or Hummingbot upstream submission mechanics.

Deliverables

  • New routes + handlers + queries + additive migration(s) for keys and (if needed) stream cursors.
  • indexer/tests/api_book_snapshot.rs, api_markets.rs, api_stream_book.rs, api_stream_trader_auth.rs, api_read_keys.rs (or equivalent), plus contract/schema fixtures.
  • docs/indexer-http.md + docs/integrators.md + docs/runbooks/bot-market-data.md; OpenAPI annotations.
  • skills/AGENTS_BOT_MARKET_DATA.md with invariants MD1–MD10; docs/qa/issue-<n>/README.md; make verify-issue-<n>; scripts/verify-issue-<n>.sh.
  • Cross-links from the Hummingbot connector issue(s) to this issue, and a comment here once they exist.

First-pass model recommendation

Recommendation: a high-capability coding model with Postgres + Rust/Axum experience. The risky parts are the freshness/unknown≠empty contract, streaming backpressure, and auth/replay handling; a wrong default there silently becomes a bot that trades on stale or fabricated depth.

# Summary External trading bots (market makers, cross-venue arbitrage, Hummingbot-class connectors) need a read surface that is cheap for the indexer, honest about freshness, and stable enough to build a maintained connector against. Today the only bot-usable book endpoints **proxy on-chain LCD walks**: each page costs `1 + N` smart queries, they are capped at `RATE_LIMIT_LCD_HEAVY_RPS` (**10 rps per socket peer IP** in production), and they cannot supply the ≥100-level depth or push streams that the Hummingbot spot-connector standard expects. The indexer already maintains an LCD-free mirror of pool reserves and the resting limit book for the route solver, but that mirror is not exposed to anyone. This issue bundles the DEX-side **read plane** for bots: 1. cached L2 book snapshots served from the existing mirror, 2. one-call market / trading-rules / venue-manifest discovery, 3. public book streaming and a per-wallet order/fill stream, 4. read-only keyed budgets so bot traffic is attributable and cannot starve retail traffic. It is a prerequisite for the two connector issues it will be cross-linked with, and it changes **no** contract behavior, quote math, or existing endpoint contract. # Community request (anonymized) A community request asked whether a Hummingbot connector is worth building for CL8Y DEX, reasoning that strategy/bot flow already reaches major centralized venues, that bots only need a discoverable, tradable and profitable market, and that this would widen reach without a marketing programme. This issue covers only the DEX read surface those connectors need. Do not retain or reproduce handles, timestamps, quotations, or any user-identifying information from that request in this issue, code, docs, tests or fixtures. # Current codebase ### Routes and rate layers - `indexer/src/api/mod.rs` wires the LCD-heavy router: `order-book-head`, `limit-book-shallow`, `limit-book`, `limit-book/insert-hints`, `route/solve`, `route/solve/best`, `route/solve/progress`, `compliance/blacklist-check`, `cg/orderbook`, `cmc/orderbook/*`. It applies `require_quote_chain` (chain-attestation gate) and `apply_rate_limit_layer(.., config.rate_limit_lcd_heavy_rps)`. - `indexer/src/config.rs`: `RUN_MODE=prod` forces `RATE_LIMIT_RPS=60` and `RATE_LIMIT_LCD_HEAVY_RPS=10` when unset/zero (`prod_forces_nonzero_rate_limits_when_zero`). Dev dual-zero is refused on a non-loopback bind unless `ALLOW_ZERO_RATE_LIMITS=1`. - `indexer/src/security.rs` keys the governor on the **socket peer IP** (`PeerIpKeyExtractor`); no `X-Forwarded-For` / `CF-Connecting-IP` trust. Listener is IPv4-only by default (`API_IPV6_ENABLED`). - 429 responses carry `Retry-After` + `x-ratelimit-*`; quote paths add `Cache-Control: no-store` via `indexer/src/api/quote_cache_control.rs`. ### LCD-proxy book (expensive, paginated) - `GET /api/v1/pairs/{addr}/limit-book?side=&limit=&after_order_id=` — default 50, **max 100** rows, one page ≈ `1 + N` LCD smart queries. - `GET /api/v1/pairs/{addr}/order-book-head`, `.../limit-book-shallow` (default 10, max 20), `.../limit-book/insert-hints` (≤100 prices, one walk). - Documented in `docs/limit-orders.md` § *Indexer limit book (LCD proxy)* and `docs/integrators.md`. ### LCD-free mirror (exists, unexposed) - `indexer/src/indexer/book_snapshot.rs` runs every `BOOK_SNAPSHOT_INTERVAL_MS` (**10 000 ms**) and upserts: - `resting_limit_orders` (`order_id`, `side`, `price`, `remaining`, `owner`, `expires_at`, `block_height`, `snapshot_at`, `walk_index`) — wholesale replace per pair, `walk_index` preserves on-chain FIFO after `UpdateLimitOrderPrice` (L23 / #1227). - `pair_reserves` / `hybrid_pair_reserves` (`reserve_0`, `reserve_1`, `fee_bps` with `-1` = unobserved, `block_height`, `snapshot_at`) — independent generations since #1453. - Freshness constants: `BOOK_SNAPSHOT_STALENESS_TOLERANCE_CYCLES = 2`, `BOOK_SNAPSHOT_MAX_STALENESS_MS = 20_000`; `AppState.book_snapshot_max_staleness_ms`. - Consumers: `indexer/src/api/db_orderbook_sim.rs` (`MirrorLoadMeta { db_hybrid_queries, lcd_fallback_queries, mirror_stale_hops, mirror_missing_hops, max_snapshot_age_ms }`) and the solver only. No HTTP route exposes the mirror. ### Bot-shaped reads that already exist (DB-backed) - `GET /api/v1/pairs`, `/{addr}`, `/{addr}/stats`, `/{addr}/trades` - `GET /api/v1/pairs/{addr}/limit-placements|limit-cancellations|limit-fills`, `/{addr}/limit-orders/{order_id}/fills` - `GET /api/v1/traders/{addr}/limit-placements|limit-cancellations|limit-fills|trades|positions` - `GET /api/v1/tokens`, `/{addr}`, `/{addr}/pairs` - `GET /api/v1/route/solve` — already zero-LCD (`local_v1`), returns `hops`, `router_operations`, `estimated_amount_out_net`, `optimality_scope`, `snapshot_age_ms`, `snapshot_block_height`, `quote_kind`. - `GET /api/v1/health`, `/ready`, `/ready-api`, `GET /api/v1/health/fee-discount`. ### Missing pieces (the gap) - No cached book/depth endpoint; no per-market trading rules (tick/price band, min remainder, rung/step caps, paused/blacklist/frozen); discovery requires several calls and omits decimals. - No streaming transport of any kind: `indexer/Cargo.toml` has no WebSocket/SSE dependency. - No API keys / keyed budgets; one bot behind one egress IP shares the 10 rps LCD-heavy budget with retail. - No venue manifest (chain-id, factory/router/fee-discount addresses, gas floor) so every client hardcodes deployment constants. - No documented freshness contract for external consumers (only internal `snapshot_age_ms`). # Why - A market maker on five pairs refreshing every second would issue ~5 `limit-book` calls/s, each costing `1 + depth` LCD queries, against a 10 rps per-IP cap. That is both an LCD-amplification risk and a guaranteed 429 for legitimate bots (and for retail behind the same NAT). - Hummingbot's spot-connector standard requires an order book channel of **minimum depth 100** plus a **private user order/trade channel**; the current API cannot satisfy either. - Discoverability is a product feature: if a bot cannot read rules (tick/band/min-size/fees/pause) and a fresh book in a few calls, it will not trade here regardless of profitability. - Bot traffic is currently unattributable: abuse and accidental loops look identical to retail, and there is no way to grant a known integrator a bounded, revocable budget. - The mirror already exists and is already trusted by the solver; exposing it costs no additional LCD work. # Constraints and guardrails 1. **Zero LCD in the request path.** New snapshot/markets/stream endpoints must serve exclusively from Postgres mirrors. Anonymous and keyed reads must not add `lcd_*` queries. Enforce with a test that asserts an LCD mock receives zero calls on these routes. 2. **Honest freshness.** Every snapshot carries `snapshot_at`, `age_ms`, `block_height`, `stale` and `source`. **Unknown ≠ empty**: a missing/stale reserves row must be distinguishable from "no resting orders". A `stale: true` snapshot is advisory only and must never be presented as tradeable depth. 3. **Depth is raw and post-fee.** `remaining` is the on-chain post-maker-fee escrow; `price` is raw token1-per-token0 (`Decimal` atomics). Document the basis and decimals next to the field. Do not humanise, invert, or compute USD in this endpoint. 4. **No identity expansion.** `owner` is already public on-chain; do not add trader tiers, balances, IPs, or any other actor data. No hashing scheme that pretends to anonymise a public chain address. 5. **Additive and backwards compatible.** Keep `limit-book*` contracts, caps and rate buckets unchanged. Migrations must be additive and indexed; no new required env var (defaults only); Coolify single-container deploy must keep working. 6. **Read-only auth.** Keys/streams grant no write, custody, or chain access. Keys are hashed at rest, revocable, scoped to read routes, never accepted in a URL, and never logged. 7. **Bounded fanout.** Per-connection depth cap, per-key and per-IP connection caps, message-rate cap, heartbeat, slow-consumer disconnect, bounded memory, reconnect backoff. 8. **Cache semantics.** Dynamic bot endpoints send `Cache-Control: no-store` (they are chain state, not static). `ETag`/`304` is allowed **only** when derived from a server-computed generation (`snapshot_at` + `block_height`) — never from a client-supplied value. 9. **Rate-limit keying stays socket-peer IP for anonymous traffic.** Do not add a spoofable XFF extractor. If keys are added, they add budget for that key only and cannot raise anonymous or per-IP limits. 10. **Privacy and process.** No chat excerpts, handles or operator identities in code, docs, fixtures, metrics labels or logs. Unavailable live checks are explicit `SKIP`; executed failures remain `FAIL`. 11. **Production posture.** `RUN_MODE=prod` forced limits remain; no new public unauthenticated mutation surface; `/metrics` is still not exposed (observability is `tracing` per #200). # Relevant files | Area | Files | | --- | --- | | Routes / state / limits | `indexer/src/api/mod.rs`, `indexer/src/config.rs`, `indexer/src/security.rs`, `indexer/src/startup.rs` | | Mirror + queries | `indexer/src/indexer/book_snapshot.rs`, `indexer/src/db/queries/resting_orders.rs`, `indexer/src/db/queries/pair_reserves.rs`, `indexer/src/api/db_orderbook_sim.rs` | | Pairs / tokens / fills | `indexer/src/api/pairs.rs`, `indexer/src/api/tokens.rs`, `indexer/src/api/traders.rs`, `indexer/src/db/queries/limit_order_fills.rs` | | Attestation / cache | `indexer/src/api/quote_cache_control.rs`, `docs/runbooks/chain-attestation.md` | | Migrations | `indexer/migrations/` | | Docs | `docs/indexer-http.md`, `docs/indexer-invariants.md`, `docs/limit-orders.md`, `docs/integrators.md`, `docs/runbooks/book-snapshot-mirror.md`, OpenAPI annotations in `api/*.rs` | | Contract truth (reference only) | `smartcontracts/packages/dex-common/src/pair.rs`, `smartcontracts/packages/dex-common/src/limit_placement.rs` | | Tests | `indexer/tests/api_limit_book_deep.rs`, `indexer/tests/book_snapshot_loop.rs`, `indexer/tests/db_orderbook_mirror.rs`, `indexer/tests/api_route_solve.rs` | # Recommended direction ### Phase 1 — cached L2 snapshot `GET /api/v1/pairs/{addr}/book/snapshot?depth_bids=100&depth_asks=100` ```json { "pair": "terra1…", "token_0": "terra1…", "token_1": "terra1…", "token_0_decimals": 6, "token_1_decimals": 6, "price_basis": "raw token1 per token0 (Decimal atomics)", "fee_bps": 180, "fee_bps_observed": true, "reserves": { "reserve_0": "…", "reserve_1": "…" }, "bids": [{ "order_id": 41, "price": "…", "remaining": "…", "owner": "terra1…", "expires_at": null, "walk_index": 0 }], "asks": [{ "order_id": 57, "price": "…", "remaining": "…", "owner": "terra1…", "expires_at": 1760000000, "walk_index": 0 }], "snapshot_at": "2026-10-20T00:00:00Z", "age_ms": 4100, "block_height": 123456, "stale": false, "depth_truncated": false } ``` - Depth defaults 100, hard cap configurable (e.g. 500 per side) with `depth_truncated` rather than silent truncation. - 404 unknown pair, 400 invalid depth/side, 503 only when the mirror row is absent **and** a documented freshness policy says so; otherwise return `stale: true` with the last good snapshot. - `ETag` from `(snapshot_at, block_height, depth)`; support `If-None-Match` → `304`. ### Phase 2 — venue manifest + discovery (one call) `GET /api/v1/markets` (paginated, stable sort by pair id): - `chain_id` (`columbus-5`), `gas_price_uluna` (`28.325`), `router`, `factory`, `fee_discount_registry`, `treasury` — from indexer config/env, never hardcoded in clients. - per market: `pair`, `base`/`quote` token address, symbol, decimals, `fee_bps`, `effective_fee_note`, `price_band_min/max` (human 1e-9…1e9), `min_place_remaining_raw` (10), `max_batch_rungs` (pair query, cached from indexer), `max_adjust_steps_cap` (256), `max_maker_fills_cap` (100), `paused`, `blacklisted`, `code_id_frozen`, `hook_addresses`, `indexed_at`, `snapshot_at`. - Discovery must not fabricate flags it cannot read; unknown = `null` with a reason string, never `false`. ### Phase 3 — streaming - `GET /api/v1/stream/book?pairs=<csv>&depth=100` (SSE first; a WebSocket wrapper is optional if upstream review requires it). Events: `snapshot` (initial), `update` (pair, generation, block height, changed levels), `heartbeat`. `id:` = monotonic generation for `Last-Event-ID` resume within a bounded replay window; gap beyond the window → new `snapshot` and a client-visible `resync` flag. - `POST /api/v1/auth/challenge` → short-lived nonce; `POST /api/v1/auth/verify` with a canonical, domain-separated signed message (chain-id + host + nonce + expiry) → short-lived read token. - `GET /api/v1/stream/trader/{addr}` with that token: order placements, fills, cancellations, parks (`reason`), claims — only for the authenticated address. Anonymous access to this stream is refused (public chain history remains available through existing REST). ### Phase 4 — keyed budgets - `X-API-Key` (hashed at rest) mapped to `{rps, burst, max_streams, depth_cap}`; admin-managed outside the request path (env file or SQL, operator-run script; no HTTP admin route in this issue). - 429 remains authoritative with `Retry-After`; keys never bypass per-IP anonymous caps. Document anonymous caps as the default contract. ### Phase 5 — contract, docs, verification - Freeze a versioned response contract (`schema_version`), document freshness/`stale` semantics, publish it in `docs/indexer-http.md`, add OpenAPI (`utoipa`), add a `skills/AGENTS_BOT_MARKET_DATA.md` playbook with invariants, a `docs/qa/issue-<n>/README.md` checklist, and `make verify-issue-<n>`. # Given / When / Then **Given** the indexer mirror is fresh for pair P and the LCD is unreachable, **When** a bot calls `GET /api/v1/pairs/P/book/snapshot?depth_bids=100` and `GET /api/v1/markets`, **Then** both answers come from Postgres with zero LCD queries, carry `snapshot_at`/`age_ms`/`block_height`/`stale`, and the depth ordering matches on-chain FIFO (`walk_index`, not `order_id`). **Given** the mirror is older than the configured staleness budget, **When** the bot requests the snapshot or a book stream, **Then** the response is explicitly `stale: true` (REST) or emits `resync` (stream) and never presents the data as current, and the bot-side guard can refuse to trade. **Given** a market is paused, blacklisted, or its code id is frozen, **When** the bot reads `/api/v1/markets`, **Then** the flag is present and truthful, and an unreadable flag is `null` with a reason rather than a false `false`. # Acceptance criteria 1. `GET /api/v1/pairs/{addr}/book/snapshot` serves bids/asks from `resting_limit_orders` in `walk_index` order, includes reserves/fee/freshness, honours depth caps, and performs **zero** LCD queries (asserted by test). 2. Missing reserves vs empty book vs stale snapshot are three distinguishable states; `stale` is set from `BOOK_SNAPSHOT_MAX_STALENESS_MS` (boundary tested on both sides). 3. `ETag`/`304` works and cannot be forced by client input; `Cache-Control: no-store` is set on all new dynamic routes. 4. `GET /api/v1/markets` returns chain/venue manifest plus per-market decimals, fee, price band, min remainder, rung/step/maker-fill caps, paused/blacklist/frozen flags, and `snapshot_at`; pagination is stable and bounded. 5. `GET /api/v1/stream/book` delivers initial depth ≥100 per pair, ordered updates with generation/height, heartbeat, `Last-Event-ID` resume, and an explicit `resync` when resume is impossible. 6. `POST /api/v1/auth/challenge` + verify yields a short-lived read token; signature is domain-separated (chain-id + host + nonce + expiry), single-use, replay-rejected; a token only authorises its own address. 7. `GET /api/v1/stream/trader/{addr}` delivers placements/fills/cancels/parks/claims for that address only, with no cross-address leakage, and refuses unauthenticated access. 8. Keyed budgets: a valid key raises only its own budget; invalid/revoked/absent keys fall back to anonymous caps; 429 includes `Retry-After`; no key value appears in logs, traces, errors, or URLs. 9. Connection/fanout caps hold: N+1 streams are refused predictably, a slow consumer is disconnected, and memory stays flat over a 10-minute soak. 10. Existing endpoints (`limit-book*`, `route/solve*`, `/pairs`, `/traders/*`) are byte-compatible and keep their rate buckets; regression suites pass unchanged. 11. OpenAPI documents every new route, and `docs/indexer-http.md` + `docs/integrators.md` describe freshness, caps, and the mirror-vs-LCD distinction. 12. `make verify-issue-<n>` exists and passes; `docs/qa/issue-<n>/README.md` checklist and `skills/AGENTS_BOT_MARKET_DATA.md` are present with invariants **MD1–MD10**. 13. No secrets, chat text, handles or user identifiers appear in code, docs, fixtures, logs or metrics labels. # Test plan — all paths | # | Path | Case | Expected | | --- | --- | --- | --- | | T1 | Unit | Snapshot maps mirror rows in `walk_index` order, bids/asks separated | Ordering equals fixture walk | | T2 | Unit | `depth=0`, negative, float, exponent, string, huge (1e9) | 400 for invalid; clamp + `depth_truncated` for oversize; never allocate unbounded | | T3 | Unit | Unknown pair, pair without reserves row, empty book | 404 / `reserves: null` + `stale` semantics / `bids|asks: []` (not stale) | | T4 | Unit | `fee_bps = -1` (unobserved) | `fee_bps_observed: false`, never `0` | | T5 | Integration (Postgres) | Mirror populated, LCD mock counting | Snapshot == rows; `lcd_calls == 0` | | T6 | Integration | Staleness at 19.9 s and 20.1 s | `stale:false` then `stale:true` | | T7 | Integration | Mirror row updated between two calls | `ETag` changes; `If-None-Match` old value → 200 with new body, current value → 304 | | T8 | Integration | `/markets` with paused, blacklisted, frozen, listing-excluded, missing-metadata pairs | Truthful flags/`null` + reason; excluded pairs follow existing policy | | T9 | Integration | `/markets` pagination at boundaries (first, last, beyond end) | Stable, no duplicates, documented empty page | | T10 | Stream | Two pairs × depth 100 initial + update ordering | Sequence monotonic, per-pair isolation, correct `walk_index` order | | T11 | Stream | `Last-Event-ID` within window / beyond window / unknown id | Replay / `resync` + fresh snapshot / `resync` | | T12 | Stream | Heartbeat and idle timeout; half-open TCP | Heartbeat observed; dead peer reaped within bound | | T13 | Stream | Slow consumer exceeding buffer | Disconnected with a typed reason; other streams unaffected | | T14 | Auth | Valid signature | Token issued, scoped to address, expires | | T15 | Auth | Wrong signature, wrong chain-id, wrong host, expired nonce, reused nonce, wrong bech32 prefix, mixed case | 401/403 with reason; no token; no state change | | T16 | Auth | Token used for another address stream | 403; no rows | | T17 | Budget | Anonymous at cap; keyed below/above cap; revoked key; malformed key | 429 with `Retry-After`; keyed budget honoured; revoked → anonymous caps | | T18 | Budget | Burst then sustained | Token-bucket behaviour matches configured rps/burst | | T19 | Load | 50 keys × 5 rps snapshot for 10 min | p95 latency within budget, flat RSS, zero LCD calls, no 5xx | | T20 | Regression | `limit-book*`, `route/solve*`, `/pairs`, `/traders/*` | Unchanged responses and rate buckets | | T21 | Ops | `RUN_MODE=prod`, missing optional env | Starts with documented defaults; forced limits intact | | T22 | Deploy | Coolify single-container, migrations on boot | Migrations additive, idempotent, no downtime requirement | # Adversarial test plan — attack, hack, abuse | # | Vector | Attack | Required behaviour | | --- | --- | --- | --- | | A1 | LCD amplification | Flood snapshot/stream endpoints to drive chain load | Zero LCD fan-out by construction; assert counter stays 0 | | A2 | Parameter amplification | `depth=999999999`, deep pagination, comma-bomb `pairs=`, duplicate pairs | Bounded parse + hard caps + 400/`depth_truncated`; no OOM | | A3 | Rate-limit bypass | Spoofed `X-Forwarded-For`/`CF-Connecting-IP`, rotating IPv6, key header guessing | Peer-IP keying retained; keys not guessable (high-entropy, hashed, timing-safe compare); no bypass | | A4 | Auth replay / cross-chain replay | Replay a valid signed challenge on another host/chain, or twice on the same host | Domain separation + single-use nonce store + short expiry; rejected | | A5 | Stream eavesdropping | Subscribe to another trader's stream, tamper with path/param | Refuse unless the token's address matches; no rows leaked; timing does not reveal existence | | A6 | Fake freshness | Forge `If-None-Match`, `Last-Event-ID`, or clock-skew to pin stale data as fresh | Generation is server-computed; forged ids → `resync`; client clocks never trusted | | A7 | Cache poisoning | Shared proxy caches a snapshot across keys/traders | `no-store` on dynamic/private routes; `Vary` where relevant; private stream never cacheable | | A8 | Connection exhaustion | Open/reopen thousands of streams from one peer | Per-IP and per-key connection caps, handshake budget, reconnect backoff, predictable 429/close code | | A9 | Slowloris / half-open | Hold sockets without reading | Idle/heartbeat timeout and write-buffer disconnect | | A10 | Data poisoning | Tamper with indexer DB mirror rows and read them back as "current" | Staleness/height monotonicity guards; no write path via HTTP; operator-only DB access documented | | A11 | Key leakage | Search logs, errors, URLs, metrics for keys/tokens | Redaction test: secrets never rendered; auth failures log reason + address only | | A12 | Enumeration / surveillance | Enumerate all traders via stream or markets | Only public on-chain order data exposed (already public); no added aggregation of actor behaviour | | A13 | Abuse of "stale" | Client ignores `stale` and trades on frozen depth | Server-side contract clear; connector issue must fail closed (cross-linked) | | A14 | Supply chain | Malicious SSE/WS dependency | Prefer std/axum-native streaming; no new native deps without review (see `docs/supply-chain-security.md`) | # Verification criteria - `make verify-issue-<n>` runs: `cargo fmt --check`, `cargo clippy -- -D warnings`, unit tests, Postgres integration tests (T5–T9, T14–T18), stream/auth tests (T10–T13), the zero-LCD assertion (T5/A1), OpenAPI/documentation link checks, and a schema contract diff. - `make test-indexer-integration` (or the subset documented in the checklist) passes with a disposable DB per `docs/runbooks/indexer-database-isolation.md`. - `docs/qa/issue-<n>/README.md` records each acceptance criterion as PASS / FAIL / SKIP with the exact command and result. Unavailable live checks are explicit SKIP and do not close acceptance; executed failures stay FAIL. - Read-only production receipts (no wallet, no mutation): `curl -s https://indexer.dex.cl8y.com/api/v1/markets | jq …`, snapshot curl for one pair, one SSE capture with `--max-time`, with UTC timestamps and the served git SHA (`/health` `git_sha`). - A short soak receipt: 10-minute load with p95, error count, RSS, and `lcd_calls == 0`. - Restart/deploy receipt: additive migration applies on an existing DB copy; `/ready` and `/ready-api` still truthful. - Source-only checks are explicitly **not** proof of deployment acceptance. # Out of scope - Any order placement, signing, custody, or key management (connector issues). - Changes to quote math, route ranking, solver bounds, fee logic, or contract messages. - A global exchange-grade ticker/trade WebSocket for listing sites (CG/CMC/GeckoTerminal have their own adapters). - CL8Y Bridge / cross-chain settlement. This read plane does not serve bridge state; bridge-backed cross-chain arbitrage and inventory rebalancing are scoped in [#1582](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1582), which consumes the deployed bridge (`https://bridge.cl8y.com`). - Marketing, listings, or Hummingbot upstream submission mechanics. # Deliverables - New routes + handlers + queries + additive migration(s) for keys and (if needed) stream cursors. - `indexer/tests/api_book_snapshot.rs`, `api_markets.rs`, `api_stream_book.rs`, `api_stream_trader_auth.rs`, `api_read_keys.rs` (or equivalent), plus contract/schema fixtures. - `docs/indexer-http.md` + `docs/integrators.md` + `docs/runbooks/bot-market-data.md`; OpenAPI annotations. - `skills/AGENTS_BOT_MARKET_DATA.md` with invariants **MD1–MD10**; `docs/qa/issue-<n>/README.md`; `make verify-issue-<n>`; `scripts/verify-issue-<n>.sh`. - Cross-links from the Hummingbot connector issue(s) to this issue, and a comment here once they exist. # First-pass model recommendation Recommendation: a high-capability coding model with Postgres + Rust/Axum experience. The risky parts are the freshness/`unknown≠empty` contract, streaming backpressure, and auth/replay handling; a wrong default there silently becomes a bot that trades on stale or fabricated depth.
Author
Owner

Dependent connector issues: (#1581) Hummingbot spot connector and (#1582) Hummingbot Gateway Terra Classic chain + CL8Y router/AMM connector.

Phase 1 (book snapshot) and Phase 2 (/markets) unblock the spot connector's degraded-but-safe path. Phase 3 (book stream at depth >= 100 and the authenticated per-wallet order/fill stream) satisfies the two Hummingbot channels that no current endpoint can provide.

Dependent connector issues: [(#1581) Hummingbot spot connector](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1581) and [(#1582) Hummingbot Gateway Terra Classic chain + CL8Y router/AMM connector](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1582). Phase 1 (book snapshot) and Phase 2 (`/markets`) unblock the spot connector's degraded-but-safe path. Phase 3 (book stream at depth >= 100 and the authenticated per-wallet order/fill stream) satisfies the two Hummingbot channels that no current endpoint can provide.
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#1580
No description provided.