Skip to main content

Venue retention

Set how many years a venue keeps its trades and orders, preview the monthly run, read the append-only archive, and hold records back with a legal hold.

A venue records every order, order event and trade it processes. A retention policy sets how many years records remain active on the venue before a monthly run copies expired records into an append-only archive and deletes them from active venue tables. A legal hold exempts matching records until released.

The period and the preview

Each venue sets one retention period: a whole number of years from 1 to 100, or none (the default, keeping records indefinitely). Organisation members read the policy via GET /api/v2/addons/trading-venues/{venueAddress}/retention-policy, and venue admins update it via PUT with retentionYears and wallet verification. See the API reference for schemas.

When the Venue configuration change row under Organisation settings → General → Approvals → Trading venues is enabled, updating the period creates a venue-retention-policy approval requiring a second venue admin. When disabled, it applies immediately.

Before saving a numeric period, venue admins can preview impact via GET .../retention-policy/preview?retentionYears=<years>, which returns counts of eligible orders, orderEvents and trades (excluding records under legal hold or still referenced by active trades, deliveries, staged fills or reservations). In the Console, Listing rules → Data retention requires running Preview before enabling Save retention period.

What the monthly run removes

The retention job runs on the first of each month at 03:15 UTC per venue (failures log and retry next run without blocking other venues), using the run date minus the retention period as the cutoff:

  • Trades: Eligible once delivered or undone, executed and last updated before the cutoff, with no unresolved delivery (archiving fee lines and resolved delivery alongside).
  • Orders: Eligible once closed, created and last updated before the cutoff, with no trade, delivery, staged fill or active reservation referencing them (archiving released reservations and order events alongside, while standalone events such as session transitions stay).

Rows are deleted only after verifying the archive holds an identical payload (mismatches stay on the venue and are counted). Every archived record stores all participating wallets (makers and recipients) for wallet-based search and legal holds.

What the archive holds

The archive stores one append-only record set per kind (order, order-event, trade) in PostgreSQL, keyed by organisation, venue and source ID with top-level numeric fields serialised as strings to preserve precision. DALP refuses updates, deletes and truncates on archive rows.

Each batch processes one instrument at a time (trades before orders) under the venue's retention lock, reading active legal holds and archiving up to 500 eligible rows per batch. Placing a legal hold acquires the same lock so newly recorded holds take effect before the next batch.

Read and export the archive

GET /api/v2/reporting/venues/{venueAddress}/archived-records pages archived records oldest first by from, to, kind, limit and cursor (invalid cursors return 400). GET .../archived-records/export streams the same filter as CSV with JSON payloads and logs an audit entry.

Reading or exporting requires an organisation owner, platform administrator or system reporting role alongside a wallet holding venue operator or venue admin on that venue (other callers receive venue not found).

A legal hold keeps matching records out of every subsequent retention run. POST /api/v2/reporting/venues/{venueAddress}/legal-holds accepts optional bounds (marketId, participantAddress, half-open [fromAt, toAt) window) plus a required reason (omitting all bounds holds the entire venue). Trades match by execution time, orders match if alive at any point in the window, and participant holds cover both maker and recipient roles.

Organisation owners and platform administrators acting on a venue operator or admin wallet place and release holds (impersonated sessions return 403 on place and release so one person cannot act as both requester and approver). GET .../legal-holds lists active and released holds with actors and reasons.

Releasing a hold follows Organisation settings → General → Approvals → Reporting → Venue legal hold release (off by default):

  • Approval on: POST .../legal-holds/{holdId}/release-requests opens a request (409 if one is already open), and a different approver calls POST .../legal-holds/{holdId}/release-decisions with approve or reject (self-approval returns 403).
  • Approval off: Requesting release immediately releases the hold with releasedBy set to approval-policy-waiver.

Rejections keep the hold active, decisions with no pending request or requests on already-released holds return 409, and unknown hold IDs return 404. In the Console, manage holds on the venue's Legal holds tab (see Legal holds and Trading Venue).

Was this page helpful?