Skip to content

Commit

Permalink
ParametersBatchUpdater overview
Browse files Browse the repository at this point in the history
  • Loading branch information
uprotocore committed Nov 29, 2023
1 parent 183cfd6 commit 396e11b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions doc/dev/ParametersBatchUpdater.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ParametersBatchUpdater Smart Contract Overview

The `ParametersBatchUpdater` is a smart contract in the Unit Protocol designed for efficient updates of various parameters across multiple contracts within the protocol.

## Key Components and Features

### 1. Inheritance
- Inherits from the `Auth` contract for restricted access control.

### 2. State Variables
- **vaultManagerParameters**: Immutable reference to IVaultManagerParameters.
- **oracleRegistry**: Immutable reference to IOracleRegistry.
- **collateralRegistry**: Immutable reference to ICollateralRegistry.
- **BEARING_ASSET_ORACLE_TYPE**: Constant for bearing asset oracle type.

### 3. Constructor
- Initializes with references to VaultManagerParameters, OracleRegistry, and CollateralRegistry contracts.

### 4. Managerial Functions
- **setManagers**: Updates permissions for multiple manager addresses.
- **setVaultAccesses**: Grants or revokes Vault access for multiple addresses.
- **setStabilityFees**: Sets stability fees for various assets.
- **setLiquidationFees**: Adjusts liquidation fees for multiple assets.
- **setOracleTypes**: Toggles oracle types for specific assets.
- **setTokenDebtLimits**: Modifies USDP debt limits for a range of assets.
- **changeOracleTypes**: Alters oracle types for given assets and users.
- **setInitialCollateralRatios**: Updates collateral ratios for various assets.
- **setLiquidationRatios**: Sets new liquidation ratios for multiple assets.
- **setLiquidationDiscounts**: Changes liquidation discounts for different assets.
- **setDevaluationPeriods**: Adjusts devaluation periods for several assets.
- **setOracleTypesInRegistry**: Updates oracle types in OracleRegistry for multiple oracles.
- **setOracleTypesToAssets**: Links oracle types to specific assets.
- **setOracleTypesToAssetsBatch**: Batch sets oracle types for asset arrays.
- **setUnderlyings**: Defines underlying assets for bearings in the oracle.
- **setCollaterals**: Configures and adds collateral parameters for asset lists.
- **setCollateralAddresses**: Adds or removes assets from the collateral registry in batch.

## Purpose and Use Case

`ParametersBatchUpdater` plays a vital role in managing and updating crucial parameters in the Unit Protocol. Its functions include:

- Adjusting risk parameters like stability fees, liquidation fees, and collateral ratios to respond to changing market conditions and maintain protocol stability.
- Managing oracle settings to ensure accurate asset price feeds.
- Updating collateral assets in response to changing acceptance criteria.

This contract improves efficiency in managing numerous parameters and assets, allowing the protocol to quickly adapt to new requirements or market conditions.

In essence, `ParametersBatchUpdater` is a key tool for protocol governance for maintaining and updating important parameters across the Unit Protocol ecosystem.

0 comments on commit 396e11b

Please sign in to comment.