> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Operating Lerian Consignado — Dataprev

> Operating Lerian Consignado: the 24-hour Dataprev auction-discovery window, escrituração and CEF repasse reconciliation, credential rotation, and rate limits.

Lerian Consignado — Dataprev handles the operational realities of payroll lending. Auction windows close on a clock. Settlement arrives late and without a terminal signal. Credentials rotate per institution. The rail tolerates only so many requests per second. The gateway manages each concern under full per-tenant isolation.

## Auction window

***

Each worker loan request opens a **24-hour auction**. The discovery poller lists new requests. The automatic path does not submit or track proposals: it has no authorized producer for the mandatory proposal terms, so no bid can be selected or reach the rail.

## Reconciliation grain

***

Reconciliation runs at **two grains**:

* **Escrituração — per contract.** The gateway captures each contract's installment record once per (competência, employer) snapshot.
* **Repasse — per record.** Each settlement record has an append-only, immutable identifier. The gateway **re-reads it on every tick** across a sliding window of competências.

The rail exposes **no deterministic final competência** and **no per-competência terminal status**. The gateway therefore treats the **presence of a settlement record as the settled predicate**. It re-polls the window to catch late D+2 settlements: terminations, arrears, and corrections that land after the first pass. The gateway measures D+2 from the employer's payroll payment.

## Credentials and rotation

***

Credentials rotate **per tenant** through the control plane. When you register a certificate or OAuth secret, the gateway upserts or rotates the stored value. The same surface holds the institution's Dataprev *código solicitante* — the three-digit requester code, `001` through `999`. The gateway caches the per-tenant Dataprev client and refreshes it on rotation, so a rotation takes effect without a redeploy. No read returns a secret.

## Idempotency and redelivery

***

The gateway keys every record and settlement by its **immutable subject**. At-least-once redelivery and restarts therefore dedupe to a no-op downstream. A reprocessed record never double-counts a settlement.

## Rate limiting

***

Each tenant's Dataprev client carries one outbound limiter, capped at **25 requests per second**. The auction-discovery and reconciliation pollers share this limiter, so neither one starves the other or exceeds the rail's limit.
