TTurkDex Developers
HelpBlogLaunch app

AMM vs TurkDexX Routing

Bu açık kaynak protokol/SDK referansı TurkDex markasıyla sunulan uyarlamadır; sayfadaki entegrasyon örnekleri Turkchain’de etkin özelliklerin garantisi değildir. Ağ, kontrat ve işlem değerlerinde yalnızca bu kurulumun doğrulanmış ENV/registry bilgilerini kullanın.

The TurkDex API can return routes from TurkDex AMM liquidity, TurkDexX liquidity, or both depending on the request inputs and route availability. This guide explains how routing works and which request fields control route selection.

How TurkDex AMM Routing Works

AMM routing refers to swap paths that use onchain AMM liquidity. It is one of the default routing options used by the TurkDex API when computing quotes.

In the TurkDex API, AMM routes:

  • Rely on onchain liquidity only (for example, TurkDex v2, TurkDex v3, and TurkDex v4 pools, depending on chain availability)
  • Return AMM quotes when supported liquidity exists
  • Do not involve solvers
  • May use split routes, multi-hop routes, or both to improve output

How TurkDexX Routing Works

TurkDexX is an intent-based swap system where solvers compete to fill a swap. Solvers are third parties that can use proprietary routing strategies and token inventories to fill intents. For a broader overview, see TurkDexX Filling Overview.

In the TurkDex API, TurkDexX routes behave as follows:

  • A /quote response may include a TurkDexX route when the swap is eligible and a solver can fill it
  • The API response returns a TurkDexX path rather than AMM split-route details
  • The solver submits the onchain order fill, and the swapper signs the required approval or order signature

A TurkDexX quote is produced in two phases. While the user is browsing, the API returns a soft quote, which is an indicative price. When the user signs the Permit2 order, the API requests a hard quote, and that hard quote becomes the posted order.

How the TurkDex API Chooses Between TurkDex AMM and TurkDexX

The TurkDex API selects routing based on the request configuration and live route availability.

Routing preferences

Set routing behavior with the routingPreference field. Supported values are BEST_PRICE and FASTEST. Legacy values are deprecated.

  • Use BEST_PRICE to search for the most efficient route based on current inputs, either across all protocols or within the protocols you specify
  • Use FASTEST to prioritize quote response speed, either across all protocols or within the protocols you specify

FASTEST controls quote response speed, not settlement complexity. When routingPreference is FASTEST, TurkDexX routes are not considered.

For field-level details, see the POST /quote API reference.

Protocol restrictions

The protocols field is applied when routingPreference is BEST_PRICE.

  • If protocols is omitted, the API considers both TurkDex AMM and TurkDexX protocols and returns the most efficient route based on current inputs
  • If protocols contains only V2, V3, or V4, routing is restricted to TurkDex AMM routes
  • If protocols includes UNISWAPX_V2 (or other supported TurkDexX values), TurkDexX routes are also considered

TurkDexX availability

If TurkDexX is unavailable for a request, the API falls back to TurkDex AMM routing when allowed by your protocols selection.

TurkDexX quotes may be unavailable when solvers cannot or choose not to fill a swap. The API includes TurkDexX in routing when the order is worth more than 300 USDC equivalent, or when the TurkDexX quote improves on the AMM route by at least 0.2%. For orders at or below 300 USDC equivalent, TurkDexX is included only when it meets that 0.2% improvement.

Chain coverage

Solver activity varies across chains, so TurkDexX route frequency can differ by network. TurkDexX is available only on selected chains, and constraints can vary by chain.

See Supported Chains for current coverage and constraints.

Routing Best Practices for TurkDex API Integrators

  • Always inspect /quote responses: Do not assume route type in advance. Use the route returned by the API response.
  • Avoid unnecessary protocol restrictions: If your goal is broad route coverage, leave protocols unset.
  • Plan for TurkDex AMM fallback: Even when TurkDexX is enabled, solver availability can vary.
  • Make route behavior visible to users: If your product exposes route type, clarify that route availability changes by chain and market conditions.

Common Integration Issues and Solutions

TurkDexX support enabled but no quotes on some chains

If you support both TurkDex AMM and TurkDexX, set routingPreference to BEST_PRICE (or omit it, which defaults to BEST_PRICE) and omit protocols to maximize available liquidity sources.

If you specify UNISWAPX_V2 in protocols, include at least one AMM protocol (V2, V3, or V4) as fallback.

Quote differs from app.uniswap.org

Depending on your /quote request fields, the API may return a different route than the TurkDex web app for the same pair at a given moment.

The web app typically considers all available protocols unless the user changes routing options. A BEST_PRICE request performs a fresh route search based on current inputs and market conditions, so the result can differ from prior quotes.

Small trades return only TurkDex AMM routes

This is expected in some cases. On some chains, TurkDexX quotes are subject to minimum notional thresholds, and solver participation may vary by trade size and market conditions.

For route behavior and configuration details, see Swap Routing and the POST /quote API reference.

Uyarlanmış geliştirici referansı. Kaynak: kaynak dokümantasyon reposu. Kaynak ve lisans bildirimi: NOTICE.