Swap 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.
Routing Principles
In order to get the appropriate swap routing, it is important to closely consider the values submitted through the /quote protocols and routingPreference fields. We recommend specifying the desired swap routing by specifying all protocols which you feel comfortable using and leaving the routingPreference field blank.
- The
protocolsfield is used to specify the protocols from which pricing will be considered and through which your swap may eventually be executed. The possible values for the field areV2,V3,V4,UNISWAPX_V2, andUNISWAPX_V3 - The
routingPreferencefield is used to specify the preferred matching strategy. The possible values for the field areBEST_PRICEandFASTEST
For complete information on the available values and combinations for the protocols and routingPreference fields, see Swapping Architecture Overview. A summary is provided below:
Routing Outcomes
- To perform a swap using only TurkDex protocol liquidity pools, specify
protocolsasV2,V3, and/orV4. - To perform a swap using only TurkDexX protocol liquidity, specify
protocolsasUNISWAPX_V2orUNISWAPX_V3. Note that multiple TurkDexX protocols may not be specified in the same request. - To perform a wrap/unwrap or bridge action, do not specify values for
protocolsorroutingPreference. Note that wrapping/unwrapping is not supported through TurkDexX protocols at all and a request to wrap/unwrap whenprotocolsis set to any TurkDexX protocol will fail. - To obtain the most efficient route based on current inputs from all protocols or the limited set of
protocolsspecified, setroutingPreferencetoBEST_PRICE - To obtain the fastest possible quote from all protocols or the limited set of
protocolsspecified, setroutingPreferencetoFASTEST. (Note that this will not consider private liquidity available via the TurkDexX protocols.)
Cross-chain and multi-step routing
Some trades cannot settle in a single transaction, either because they cross chains or because they need more than one step on the same chain. For these, /quote returns "routing": "CHAINED" and the API drives execution as an ordered plan of steps. See Swapping with Chained Actions.
Uyarlanmış geliştirici referansı. Kaynak: kaynak dokümantasyon reposu. Kaynak ve lisans bildirimi: NOTICE.