Skip to main content
Source: src/Oracle.sol

Responsibility

Oracle is the fund’s NAV/price reporting and batch clock. It:
  • Defines batches: time windows separated by nextCutoffTime. Deposit/redeem requests are grouped by batch id, and each batch is priced by exactly one accepted report per asset.
  • Receives price reports (asset price per share, 1e18-scaled) from an off-chain reporter, holds them as pending through a review window, and flags suspicious prices using configurable safety bounds.
  • Releases accepted prices to the Fund during settlement and stores lastAcceptedPrice per asset.
Prices use the convention shares = amount × 1e18 / priceprice is the amount of that asset corresponding to one share. The accept functions are onlyFund — reachable only through Fund.acceptReport / Fund.acceptSuspiciousReport. Other admin/reporter functions authorize against the Fund’s access control (spoke pattern).

Batch semantics

  • currentBatchId is the batch awaiting a report; getCurrentBatchId() returns currentBatchId + 1 once block.timestamp >= nextCutoffTime, so new requests automatically roll into the next batch while the closed batch is priced.
  • Accepting a report advances currentBatchId and requires a new future nextCutoffTime in the same call.

Report lifecycle

Timing rules

Price safety

Each check is optional; 0 disables it. A suspicious report is not rejected — it stays pending but can only be consumed via Fund.acceptSuspiciousReport (a stronger role), or replaced after rejection.

Function reference

Reporter / reviewer

Roles are checked on the Fund.

Fund-only

Reached via Fund.acceptReport*.

Admin setters

Roles are checked on the Fund.

Views

getCurrentBatchId(), currentBatchId, nextCutoffTime, getReport(asset, batchId), getPendingReport(asset, batchId), lastAcceptedPrice(asset), priceSafety(asset), minAcceptReportDelay, maxAcceptReportDelay, fund(). Fund · DepositQueue · RedeemQueue