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

# Periphery Contracts

> Supporting infrastructure -- OracleRegistry, fee calculators, and utilities

## Overview

Periphery contracts provide supporting infrastructure for the core Aera V3 vault system. They handle price feeds, fee calculation, and other utility functions that the core vaults depend on but are not part of the vault inheritance hierarchy.

***

## OracleRegistry

The `OracleRegistry` is an ERC-7726 compatible registry of price oracles for asset pairs. Vaults and hooks use it to look up current prices for exchange rate calculations, slippage enforcement, and fee computation.

### Functions

#### getOracle

Returns the oracle address for a given asset pair.

**Signature:**

```solidity theme={null}
function getOracle(address base, address quote) external view returns (address oracle)
```

| Parameter | Type      | Description         |
| --------- | --------- | ------------------- |
| `base`    | `address` | Base asset address  |
| `quote`   | `address` | Quote asset address |

**Returns:** Address of the registered oracle for the pair.

#### getPrice

Returns the current price for an asset pair from the registered oracle.

**Signature:**

```solidity theme={null}
function getPrice(address base, address quote) external view returns (uint256 price)
```

| Parameter | Type      | Description         |
| --------- | --------- | ------------------- |
| `base`    | `address` | Base asset address  |
| `quote`   | `address` | Quote asset address |

**Returns:** Current price of base asset denominated in quote asset.

#### setOracle

Registers or updates an oracle for an asset pair. Only callable by the registry owner.

**Signature:**

```solidity theme={null}
function setOracle(address base, address quote, address oracle) external
```

| Parameter | Type      | Description             |
| --------- | --------- | ----------------------- |
| `base`    | `address` | Base asset address      |
| `quote`   | `address` | Quote asset address     |
| `oracle`  | `address` | Oracle contract address |

### Events

#### OracleSet

Emitted when an oracle is registered or updated.

```solidity theme={null}
event OracleSet(address indexed base, address indexed quote, address indexed oracle)
```

***

## DelayedFeeCalculator

Fee calculator for [SingleDepositorVault](/contract-reference/single-depositor-vault) vaults. Applies time-delayed fee accrual based on vault values reported by an accountant. The delay prevents fee manipulation through short-term vault value changes.

### Functions

#### calculateFees

Calculates accrued fees based on the current vault value and time elapsed since the last report.

**Signature:**

```solidity theme={null}
function calculateFees(uint256 vaultValue) external view returns (uint256 fees)
```

| Parameter    | Type      | Description                                       |
| ------------ | --------- | ------------------------------------------------- |
| `vaultValue` | `uint256` | Current vault value as reported by the accountant |

**Returns:** Amount of fees accrued.

#### reportValue

Reports the current vault value for fee calculation. Starts or updates the time-delayed fee accrual window.

**Signature:**

```solidity theme={null}
function reportValue(uint256 vaultValue) external
```

| Parameter    | Type      | Description         |
| ------------ | --------- | ------------------- |
| `vaultValue` | `uint256` | Current vault value |

***

## PriceAndFeeCalculator

Fee calculator for [MultiDepositorVault](/contract-reference/multi-depositor-vault) vaults. Uses unit-based pricing with managed accountant snapshots for fee computation. Integrates with the `OracleRegistry` for price lookups.

### Functions

#### calculateFees

Calculates accrued fees based on the current unit price and total supply.

**Signature:**

```solidity theme={null}
function calculateFees(uint256 unitPrice, uint256 totalSupply) external view returns (uint256 fees)
```

| Parameter     | Type      | Description                  |
| ------------- | --------- | ---------------------------- |
| `unitPrice`   | `uint256` | Current price per vault unit |
| `totalSupply` | `uint256` | Total supply of vault units  |

**Returns:** Amount of fees accrued.

#### snapshot

Takes a snapshot of the current vault state for fee calculation. Called by the guardian as part of the submit flow (typically via an `afterSubmit` hook).

**Signature:**

```solidity theme={null}
function snapshot(uint256 unitPrice, uint256 totalSupply) external
```

| Parameter     | Type      | Description                  |
| ------------- | --------- | ---------------------------- |
| `unitPrice`   | `uint256` | Current price per vault unit |
| `totalSupply` | `uint256` | Total supply of vault units  |

<Info>
  This page was manually created as a baseline. Run the [contract reference generation pipeline](/contract-reference/overview#generation-pipeline) to update with complete NatSpec documentation from the Solidity source.
</Info>
