# Common Functions

The Helios protocol provides several **common utility functions** for retrieving reserve configuration data. Commonly used ones include `getReserveFactor` and `getDecimals`. These functions are used to read configuration values (stored in a reserve’s configuration map).

#### `getReserveFactor`

```solidity
function getReserveFactor(DataTypes.ReserveConfigurationMap memory config) internal pure returns (uint256)
```

Returns the **reserve factor** of a given reserve, as a `uint256`. The reserve factor represents the percentage of borrowing interest that is allocated to the Helios protocol (e.g. to a treasury or insurance fund), with the remainder of the interest going to suppliers of liquidity (holders of hTokens for that reserve).

* The reserve factor is stored as part of the reserve’s configuration bitmap (`ReserveConfigurationMap`). `getReserveFactor` isolates the reserve factor bits from this bitmap and returns their value.
* The value is expressed in basis points (bps). For example, a reserve factor of `1000` would correspond to 10% (since 1000 bps = 10%). If the reserve factor is 10%, then 10% of the interest accrued by borrowers on that asset goes to Helios, and 90% goes to the suppliers of that asset.

#### `getDecimals`

```solidity
function getDecimals(DataTypes.ReserveConfigurationMap memory config) internal pure returns (uint256)
```

Returns the number of **decimals** used by the reserve’s underlying asset, as a `uint256`. This is typically equal to the ERC20 `decimals()` of the underlying token.

* The decimals value is stored in the reserve’s configuration bitmap. `getDecimals` extracts this value from the stored data.
* Helios uses the asset’s decimals to scale values for accurate calculations. All internal accounting uses a common base (e.g. 18 decimal fixed-point math via “ray” units), so knowing the asset’s native decimals is important for conversions when minting hTokens, accruing interest, etc.


---

# 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://helios-finance.gitbook.io/helios-finance/for-developers/functions/common-functions.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.
