Router
Last updated
Last updated
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).
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.
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.
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.