# PriceProvidersRepository

> PriceProvidersRepository

A repository of price providers. It manages price providers as well as maps assets to their price provider. It acts as a entry point for Silo for token prices.

## Methods

### acceptOwnership

```solidity
function acceptOwnership() external nonpayable
```

*Transfers ownership of the contract to a pending owner Can only be called by the pending owner.*

### addPriceProvider

```solidity
function addPriceProvider(contract IPriceProvider _provider) external nonpayable
```

Register new price provider

#### Parameters

| Name       | Type                    | Description |
| ---------- | ----------------------- | ----------- |
| \_provider | contract IPriceProvider | undefined   |

### changeManager

```solidity
function changeManager(address _manager) external nonpayable
```

Change manager address

*Callable by manager or external owner role*

#### Parameters

| Name      | Type    | Description         |
| --------- | ------- | ------------------- |
| \_manager | address | new manager address |

### getPrice

```solidity
function getPrice(address _asset) external view returns (uint256)
```

Returns "Time-Weighted Average Price" for an asset

#### Parameters

| Name    | Type    | Description                                 |
| ------- | ------- | ------------------------------------------- |
| \_asset | address | address of an asset for which to read price |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | TWAP price of a token with 18 decimals |

### isPriceProvider

```solidity
function isPriceProvider(contract IPriceProvider _provider) external view returns (bool)
```

Returns true if address is a registered price provider

#### Parameters

| Name       | Type                    | Description                             |
| ---------- | ----------------------- | --------------------------------------- |
| \_provider | contract IPriceProvider | address of price provider to be removed |

#### Returns

| Name | Type | Description                                                     |
| ---- | ---- | --------------------------------------------------------------- |
| \_0  | bool | true if address is a registered price provider, otherwise false |

### manager

```solidity
function manager() external view returns (address)
```

Gets manager role address

#### Returns

| Name | Type    | Description          |
| ---- | ------- | -------------------- |
| \_0  | address | manager role address |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pendingOwner

```solidity
function pendingOwner() external view returns (address)
```

*Returns the address of the pending owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### priceProviders

```solidity
function priceProviders(address) external view returns (contract IPriceProvider)
```

Maps asset address to its price provider

*Each asset must have a price provider contract assigned, otherwise it's not supported*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

#### Returns

| Name | Type                    | Description |
| ---- | ----------------------- | ----------- |
| \_0  | contract IPriceProvider | undefined   |

### priceProvidersRepositoryPing

```solidity
function priceProvidersRepositoryPing() external pure returns (bool)
```

Sanity check funciton

#### Returns

| Name | Type | Description         |
| ---- | ---- | ------------------- |
| \_0  | bool | returns always TRUE |

### providerList

```solidity
function providerList() external view returns (address[])
```

Gets an array of price providers

#### Returns

| Name | Type       | Description              |
| ---- | ---------- | ------------------------ |
| \_0  | address\[] | array of price providers |

### providersCount

```solidity
function providersCount() external view returns (uint256)
```

Gets number of pice providers registerd

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | number of pice providers registerd |

### providersReadyForAsset

```solidity
function providersReadyForAsset(address _asset) external view returns (bool)
```

Check if prices are available for an asset

#### Parameters

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| \_asset | address | asset address to check |

#### Returns

| Name | Type | Description                                          |
| ---- | ---- | ---------------------------------------------------- |
| \_0  | bool | returns TRUE if price feed is ready, otherwise false |

### quoteToken

```solidity
function quoteToken() external view returns (address)
```

Token in which prices are quoted. It's most likely WETH, however it could vary from deployment to deployment. For example 1 SILO costs X amount of quoteToken.

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### removePriceProvider

```solidity
function removePriceProvider(contract IPriceProvider _provider) external nonpayable
```

Unregister price provider

#### Parameters

| Name       | Type                    | Description |
| ---------- | ----------------------- | ----------- |
| \_provider | contract IPriceProvider | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setPriceProviderForAsset

```solidity
function setPriceProviderForAsset(address _asset, contract IPriceProvider _provider) external nonpayable
```

Sets price provider for asset

*Request for asset price is forwarded to the price provider assigned to that asset*

#### Parameters

| Name       | Type                    | Description                                               |
| ---------- | ----------------------- | --------------------------------------------------------- |
| \_asset    | address                 | address of an asset for which price provider will be used |
| \_provider | contract IPriceProvider | undefined                                                 |

### siloRepository

```solidity
function siloRepository() external view returns (address)
```

SiloRepository contract address

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### transferPendingOwnership

```solidity
function transferPendingOwnership(address newPendingOwner) external nonpayable
```

*Transfers pending ownership of the contract to a new account (`newPendingOwner`). Can only be called by the current owner.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| newPendingOwner | address | undefined   |

## Events

### ManagerChanged

```solidity
event ManagerChanged(address manager)
```

Emitted when manager is changed

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| manager | address | undefined   |

### NewPriceProvider

```solidity
event NewPriceProvider(contract IPriceProvider newPriceProvider)
```

Emitted when price provider is added

#### Parameters

| Name             | Type                    | Description |
| ---------------- | ----------------------- | ----------- |
| newPriceProvider | contract IPriceProvider | undefined   |

### OwnershipPending

```solidity
event OwnershipPending(address indexed previousOwner, address indexed newOwner)
```

Emitted when ownership transfer is proposed, aka pending owner is set

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

Emitted when ownership is transferred on `transferOwnership` and `acceptOwnership`

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### PriceProviderForAsset

```solidity
event PriceProviderForAsset(address indexed asset, contract IPriceProvider priceProvider)
```

Emitted when asset is assigned to price provider

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| asset `indexed` | address                 | undefined   |
| priceProvider   | contract IPriceProvider | undefined   |

### PriceProviderRemoved

```solidity
event PriceProviderRemoved(contract IPriceProvider priceProvider)
```

Emitted when price provider is removed

#### Parameters

| Name          | Type                    | Description |
| ------------- | ----------------------- | ----------- |
| priceProvider | contract IPriceProvider | undefined   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devdocs.silo.finance/smart-contracts-overview/oracle/priceprovidersrepository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
