Skip to content

Remove expiry from venue cash-flow audit tables - #63

Merged
outerlook merged 1 commit into
developfrom
chore/audit-facts-no-ttl
Jul 8, 2026
Merged

Remove expiry from venue cash-flow audit tables#63
outerlook merged 1 commit into
developfrom
chore/audit-facts-no-ttl

Conversation

@outerlook

@outerlook outerlook commented Jul 8, 2026

Copy link
Copy Markdown
Member

Why

fill_events and transfer_events carried 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 by order_events and market_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

  • Drop TTL ... + toIntervalDay(90) from broker_execution.fill_events and broker_execution.transfer_events in schema/clickhouse/broker_execution.sql.
  • Correct the table comments that claimed the 90-day TTL was part of the fiet-maker consumer contract.
  • 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 EXISTS and will not alter existing tables. Deployments that already created these tables need:

ALTER TABLE broker_execution.transfer_events REMOVE TTL;
ALTER TABLE broker_execution.fill_events REMOVE TTL;

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.

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;
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20f67d36-23c1-4695-94f8-d484d51e7733

📥 Commits

Reviewing files that changed from the base of the PR and between e8c88f2 and efdd12c.

📒 Files selected for processing (1)
  • schema/clickhouse/broker_execution.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/audit-facts-no-ttl

Comment @coderabbitai help to get the list of available commands.

@outerlook
outerlook merged commit 1765f1a into develop Jul 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant