Remove expiry from venue cash-flow audit tables - #63
Conversation
fill_events and transfer_events carried a 90-day TTL inherited from an old fiet-maker schema file. The consumer contract (CEX_EXECUTION_ARCHIVE_CONTRACT.md) does not constrain retention, and this file's own policy already states that execution audit facts must not expire — order_events and market_metadata_snapshots follow it. Fills and value movements are the venue cash-flow ledger; expiring them destroys accounting history. Existing deployments must drop the expiry manually — the forwarder self-init is CREATE IF NOT EXISTS and will not alter live tables: ALTER TABLE broker_execution.transfer_events REMOVE TTL; ALTER TABLE broker_execution.fill_events REMOVE TTL;
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Why
fill_eventsandtransfer_eventscarried a 90-day TTL inherited from an old fiet-maker schema draft. The consumer contract (CEX_EXECUTION_ARCHIVE_CONTRACT.md) does not constrain retention, and this schema file's own header policy — execution audit facts must not expire — is already followed byorder_eventsandmarket_metadata_snapshots. Fills and value movements are the venue cash-flow ledger; expiring them destroys accounting history on a rolling basis, which blocks NAV/PnL reconstruction on the maker side.Both tables are currently empty in production (the archive pipeline is not deployed yet), so this changes policy, not data.
Changes
TTL ... + toIntervalDay(90)frombroker_execution.fill_eventsandbroker_execution.transfer_eventsinschema/clickhouse/broker_execution.sql.market_data.*streams keep their 90-day TTL — they are the high-volume tables; these two are low-volume.Deploy note
The archive-forwarder self-init is
CREATE TABLE IF NOT EXISTSand will not alter existing tables. Deployments that already created these tables need:Cross-repo pairing
usherlabs/fiet-maker#673 aligns the maker-side sandbox fixture with this retention policy; the two should merge in the same wave.