Architecture

Order-Router Protocol

The Haystack Order Router protocol consists of two components:

  • Haystack Order Routing Algorithm (Off-Chain): the Order Routing Algorithm computes the optimal route between two assets. The algorithm works by finding all atomic routes between the two assets, and combining them to minimize the cost of the route.

  • Haystack Order Routing App (On-Chain): the Order Routing App is used to perform multiple swaps atomically with the ability to compute asset balances before or after any swap is performed. This allows the App to execute complex routes that involve both multi-hop and combo swaps.

Last updated