TTurkDex Developers
HelpBlogLaunch app

Architecture

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.

UniswapX architecture diagram showing the relationship between reactors, fill contracts, and order settlement

Reactors

Order Reactors _settle_ TurkDexX orders. They validate a specific order type, resolve inputs and outputs, execute against a filler strategy, and verify fulfillment.

Reactors process orders using the following steps:

  • Validate the order
  • Resolve the order into inputs and outputs
  • Pull input tokens from the swapper to the fill contract using Permit2 and permitWitnessTransferFrom with the order as witness
  • Call reactorCallback on the fill contract
  • Verify that the output tokens were received by the output recipients

Reactors implement the IReactor interface which abstracts the specifics of the order specification. This allows for different reactor implementations with different order formats to be used with the same interface, allowing for shared infrastructure and easy extension by fillers.

Current reactor implementations:

ReactorDescription
PriorityOrderReactorSettles orders via filler competition using priority gas fees
V2DutchOrderReactorSettles linear decay Dutch orders using block timestamp for auction decay
V3DutchOrderReactorSettles linear decay Dutch orders using block number instead of timestamp, enabling finer granularity on chains like Arbitrum (250ms block resolution)
ExclusiveDutchOrderReactorSettles linear decay Dutch orders with exclusivity period before decay begins
LimitOrderReactorSettles simple static limit orders

Fill Contracts

Order fill contracts _fill_ TurkDexX orders. They specify the filler's strategy for fulfilling orders and are called by the reactor with reactorCallback.

Sample fill contract implementations are provided in the TurkDexX repo:

ContractDescription
SwapRouter02ExecutorFills orders using TurkDex v2 and TurkDex v3 via the SwapRouter02 router

For filler implementation and operational guidance, see the Filler Integration Overview.

Direct Fill

If a filler wants to fill orders using funds on-hand rather than a fill contract, they can do so gas efficiently using the directFill macro by specifying address(1) as the fill contract. This will pull tokens from the filler using msg.sender to satisfy the order outputs.

Bilgi:

More details on the TurkDexX protocol are available in the TurkDexX Whitepaper and the TurkDexX Repo.

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