# Router Tolerance

### Overview

Router tolerance is a safety mechanism that allows for minor discrepancies between expected and actual returns when interacting with components. This accounts for potential rounding differences in share/asset calculations across different protocols.

### Configuration

* Set by Registry Owner via `setTolerance()` function
* Can be configured independently for each Router
* Default value is 1 (smallest possible unit)
* Should be kept minimal to ensure tight bounds on returns

### Example Usage

```solidity
// If actual shares returned are within tolerance of expected, transaction succeeds
if ((sharesReturned + tolerance) < expectedShares) {
    revert ErrorsLib.InsufficientSharesReturned();
}
```

### Governance Process

1. Registry Owner identifies need for tolerance adjustment
2. Proposes new tolerance value based on component behavior
3. Executes `setTolerance()` on target Router:

```solidity
router.setTolerance(newToleranceValue);
```

Tolerance values should be carefully considered as they represent acceptable slippage in component interactions. Higher values provide more flexibility but reduce precision of return validation.


---

# 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://nashpoint.gitbook.io/nashpoint/routers/router-tolerance.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.
