# CollateralUtils

*Collaterals decimal precision internal library*

## CollateralConfig

```solidity
struct CollateralConfig {
  uint128 precision;
  uint128 precisionDelta;
}
```

## getCollateralConfig

```solidity
function getCollateralConfig(address _token) internal view returns (struct CollateralUtils.CollateralConfig _meta)
```

\_Calculates `precision` (10^decimals) and `precisionDelta` (precision difference between 18 decimals and `token` decimals) of a given IERC20 `token`

Notice: not compatible with tokens with more than 18 decimals\_

### Parameters

| Name    | Type    | Description              |
| ------- | ------- | ------------------------ |
| \_token | address | collateral token address |


---

# 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://docs.gains.trade/developer/technical-reference/contracts/libraries/collateralutils.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.
