# Router

The Router is a generic router that can register multiple routes, which can be registered The Router serves as a versatile tool that registers multiple routes for both onchain contracts and offchain swap execution engines. Users can enable or disable router registrations as needed. The Router's primary responsibility involves abstracting the preview of swapping underlying assets and executing swaps onchain based on offchain collected data. This functionality allows for more informed decision-making regarding swaps. Additionally, the Router can revert swap executions if the output amount deviates from the previewed amount by a configurable threshold, expressed in reference asset value.

* Unified API for Decentralised Applications, Smart Contracts and AI Agents:\
  Singularity Finance has developed a single, standardised interface known as the “DynaRouterAPI” for interacting with various routers (decentralised exchanges) and zappers (tools for bundling complex token interactions).\
  ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeLkDE48A8xl9TMiQMSaKQdP2EoqUIbFrx9sML0YyDp82HAB95ki-0xUV48Brkl85bEHFZ8jKKg6g9GO0VdP7kcWWdreSgSpJCyDX20AbEJ7DoU24BWvSGBQIQVAiHEMt_VnTWoZA?key=HUJOBXQsrKa0DOk8r_dxjpBF)
* Secure Decentralised Router Comparison:\
  This API standardises expected output amounts and slippage across multiple routers and zappers. It enables decentralised applications to perform multiple offchain queries to select the optimal router or zapper, ensuring slippage protection during onchain executions when entering or exiting tokenised positions.<br>
* Reduced Cost of AI Decision-Making:\
  AI agents responsible for managing portfolio rebalancing or executing strategies can easily interact with the API to move assets in and out of complex tokenised positions without the need for custom integrations for each protocol.<br>
* Future Compatibility:\
  The modular design of the generalised router framework allows for adaptability to new protocols and technologies without requiring significant changes. Users can utilise this API without concerns about future updates to routers or zappers, as the API guarantees backward compatibility and extensibility.\ <br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdyxasq-I-iZRikwtMf2PbRheCOaWP58KJn_F6GHVLc3KmIxl061DMUrUi00Q-LjbpAwF4Os6cLpQrdMJzs5i5hilhPy4lEpa9lfuP3fP8ul1xoN2QaPQ_JMX3cWxM6Uo74rXl8yw?key=HUJOBXQsrKa0DOk8r_dxjpBF" alt=""><figcaption></figcaption></figure>

\ <br>

&#x20;

<br>


---

# 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.singularityfinance.ai/sfi-value-proposition/core-pillars-of-the-sfi-l2/sfi-vaults/features/router.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.
