# Intelligent Routing

The Juspay Hyperswitch Intelligent Routing module augments your payment processing by dynamically switching between processors in real-time for every transaction to optimally maximise first attempt auth rates and minimise processing cost.

### Types of Intelligent Routing

Hyperswitch supports four intelligent routing strategies:

* **Auth Rate Based Routing:** Uses real-time success rates and ML-driven optimisation to route transactions to the best-performing gateway.
  * The Auth Rates for the payments are tracked at a granular level of payment parameters like payment method, payment method type, amount, currency, authentication type, card network etc.
  * **The model** uses a Multi-Armed Bandit (MAB) problem with Delayed Feedback, where each Gateway is an "arm" with fluctuating success rates and varying latency for success and failure. The approach used to solve this problem is driven by **explore-exploit** strategy.
    * **Exploration:** We continuously evaluate all gateways by sending a small percentage of traffic to ensure up-to-date performance data.
    * **Exploitation:** We continuously route most traffic to the best-performing Gateway to maximise the overall success rate.
  * The sensitivity of the system can be tweaked by the merchants by configuring settings such as Bucket Sizes, Parameters to be considered and Hedging Percentage
  * The hedging percentage decides the exploration factor of the model
* **Least Cost Routing:** Picks the least cost network for every transaction based on the availability of back-of-the-card network and processor compatibility
* **Elimination Routing:** Tracks acute incidents such as downtimes and technical errors to de-prioritise gateways. This will be used as a final check after other routing logics are applied.
* **Contracts-Based Routing:** Distributes payments across processors to meet contractual volume commitments. \[BETA FEATURE]

### Architecture Diagram

<figure><img src="/files/CrHE5K7heiOP9GSKmU8w" alt=""><figcaption></figcaption></figure>

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Self Deploy the Routing Engine</td><td><a href="/files/sYtzGXOLYgNsLUIhXCmU">/files/sYtzGXOLYgNsLUIhXCmU</a></td><td><a href="/pages/heeCBiRV9fVqX7UvZDdt">/pages/heeCBiRV9fVqX7UvZDdt</a></td></tr><tr><td>Using Auth Rate based Routing for Hyperswitch</td><td><a href="/files/ul4c2w84RTflfs2sTjPj">/files/ul4c2w84RTflfs2sTjPj</a></td><td><a href="/pages/FiYgqb2569Q9Qu7s5yFG">/pages/FiYgqb2569Q9Qu7s5yFG</a></td></tr></tbody></table>


---

# 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.hyperswitch.io/integration-guide/workflows/intelligent-routing.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.
