@usherlabs/cex-broker 0.2.27 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commands/cli.js +671 -543
- package/dist/helpers/broker-execution-archive/capture.d.ts +1 -1
- package/dist/helpers/broker-execution-archive/index.d.ts +1 -1
- package/dist/helpers/broker-execution-archive/rows.d.ts +1 -0
- package/dist/helpers/broker-execution-archive/writer.d.ts +10 -2
- package/dist/helpers/market-data-archive/capture.d.ts +1 -1
- package/dist/helpers/market-data-archive/index.d.ts +3 -3
- package/dist/helpers/market-data-archive/ohlcv-history.d.ts +1 -1
- package/dist/helpers/market-data-archive/rows.d.ts +1 -1
- package/dist/helpers/market-data-archive/types.d.ts +1 -1
- package/dist/helpers/shared/errors.d.ts +7 -5
- package/dist/index.js +691 -561
- package/dist/index.js.map +17 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ CLICKHOUSE_PORT=8123 bun run start-candle-viewer # http://localhost:8091
|
|
|
97
97
|
|
|
98
98
|
Dev watchers: `dev:candle-viewer`, `dev:archive-forwarder`, `dev:archive-watch` (see [research/README.md](research/README.md)).
|
|
99
99
|
|
|
100
|
-
Key env vars: `CEX_BROKER_ARCHIVE_FORWARDER_URL`, `
|
|
100
|
+
Key env vars: `CEX_BROKER_ARCHIVE_ENABLED=true`, `CEX_BROKER_ARCHIVE_FORWARDER_URL`, `CEX_BROKER_ARCHIVE_DEAD_LETTER_PATH`, and `CEX_BROKER_DEPLOYMENT_ID`. The archive is disabled for every enable value except the exact string `true`. Production durability requires the dead-letter file to reside on persistent writable storage or a mounted volume; a container-local ephemeral path is not durable.
|
|
101
101
|
|
|
102
102
|
#### Wallet-authenticated exchanges
|
|
103
103
|
|
|
@@ -724,7 +724,7 @@ Every successful `CreateOrder` response, successful `GetOrderDetails` response,
|
|
|
724
724
|
- Execution values: requested quantity/notional, executed base quantity, executed quote quantity/cost, average execution price, filled amount, remaining amount, fee amount, fee currency, fee rate
|
|
725
725
|
- Timing: exchange timestamp when present and broker observed timestamp
|
|
726
726
|
|
|
727
|
-
Use metrics for aggregations and alerts. For the durable execution audit trail, the broker archives every order lifecycle event to `broker_execution.order_events` (and pre-order top-of-book to `broker_execution.market_metadata_snapshots`) through the **archive forwarder** — the same HTTP `/archive` → ClickHouse path used for `market_data.*`.
|
|
727
|
+
Use metrics for aggregations and alerts. For the durable execution audit trail, the broker archives every order lifecycle event to `broker_execution.order_events` (and pre-order top-of-book to `broker_execution.market_metadata_snapshots`) through the **archive forwarder** — the same HTTP `/archive` → ClickHouse path used for `market_data.*`. Set `CEX_BROKER_ARCHIVE_ENABLED=true`, an explicit HTTP(S) `CEX_BROKER_ARCHIVE_FORWARDER_URL`, and a writable durable JSONL path in `CEX_BROKER_ARCHIVE_DEAD_LETTER_PATH`; startup fails if either required sink configuration is missing or invalid. In production, that path must be on persistent writable storage or a mounted volume rather than the container's ephemeral filesystem. Queue shedding and rows that remain undeliverable during shutdown are written to that loss journal with their original `{table,row}` payload before being discarded. Setting `CEX_BROKER_ARCHIVE_OTEL_LOGS_ENABLED=true` additionally mirrors execution rows to OTel logs for observability, but OTel is never the archive sink of record. Analysts join Maker action rows to `broker_execution.order_events` using `maker_action_id`, `idempotency_id`, `client_order_id`, or the exchange `order_id`, then compare Maker propAMM execution price against `average_execution_price` and fees. Failed CreateOrder rows keep bounded exchange error detail in `error_message`; their telemetry-shaped `payload_json`, metrics, and ordinary telemetry logs remain redacted. The broker does not emit raw exchange payloads, API keys, secrets, or credentials in telemetry fields.
|
|
728
728
|
|
|
729
729
|
### Telemetry Test Harness
|
|
730
730
|
|