> For the complete documentation index, see [llms.txt](https://txnlab.gitbook.io/haystack-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://txnlab.gitbook.io/haystack-dev/haystack-router/contracts.md).

# Contracts

### Mainnet

* V4 ([architecture](/haystack-dev/haystack-router/architecture/order-router-app-v4.md)): the current app, which executes every API swap.
  * App ID: [3757715482](https://lora.algokit.io/mainnet/application/3757715482)
  * Address: [3IMNKFHT7BIUBIV57Y4VYQJM4BLXXWPKWY3CUN4QOIQ33CYJAVWKUDQF3Q](https://lora.algokit.io/mainnet/account/3IMNKFHT7BIUBIV57Y4VYQJM4BLXXWPKWY3CUN4QOIQ33CYJAVWKUDQF3Q)
  * V4.3 - Added support for Pact V2 concentrated liquidity pools (protocol ID 13, V4 only).
  * V4.2 - A fixed-output route may leave input unspent, which is returned to the beneficiary with the refund.
  * V4.1 - xALGO sub-swaps raise their opcode budget per xALGO proposer.
  * V4.0 - One `route` call per swap, persistent asset holdings, an exact fixed-output with an on-chain refund, and an ARC-28 `Swap` event.
* V3 ([architecture](/haystack-dev/haystack-router/architecture/order-router-app.md)): legacy. The API stopped building for it on November 5, 2026; the app stays on chain.
  * App ID: [3172554435](https://lora.algokit.io/mainnet/application/3172554435)
  * Address: [ESPO2SMA5BPAAAFAN66EFNHGR3HJ63U2OYM6RJXSEP6YOBU4HJTWZG7D5A](https://lora.algokit.io/mainnet/account/ESPO2SMA5BPAAAFAN66EFNHGR3HJ63U2OYM6RJXSEP6YOBU4HJTWZG7D5A)
  * V3.2 - `User_opt_into_assets` no longer rekeys the app; foreign accounts are ignored.
  * V3.1 - AlgoFi nanoswap pools run as ordinary swaps: a sub-swap's metadata sets its pool call's fee, which the swapper funds.
  * V3.0 - Ported from PyTeal to Algorand TypeScript, with the same ABI. The NOP app is no longer needed in the group.
  * V2.5 - Added support for Pact V2 pools (protocol ID 12). Swaps with a zero input amount are now rejected, except fixed-output backward swaps, which are skipped.
  * V2.2 - Added support for xALGO, aligned internal min fees with router api.
* V2.1 Order Router (Added extra OpUp in User\_swap\_finalize to cover opcode cost edge case)
  * App id: [3109993177](https://lora.algokit.io/mainnet/application/3109993177)
  * App address: CJSMOFXXACDCEWJ3GGLAVXQR2MTLNYYNUVAGG6JNSZ3ETWI4LSDV2R5YKQ
    * V2.1 - Added op-up to User\_swap\_finalize call to handle an edge case with single route, dual-swap Pact swap running out of opcodes in finalize operation.
    * V2.0 - Added support for tALGO mint/unmint as part of swap routing.

V4 ARC-56 definition JSON (can be loaded into Lora, etc.)

{% file src="/files/uDDD4jQ2gHnUaxffSIfH" %}
ARC-56 JSON
{% endfile %}

V3 ARC-32 compatible ABI definition JSON

{% file src="/files/iJIdQbDRhgbg3f3SLZh8" %}
ARC4 JSON
{% endfile %}
