> For the complete documentation index, see [llms.txt](https://docs.termina.technology/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.termina.technology/documentation/developer-docs-zh/liu-cheng/zhong-lu-you-li-shi-ding-dan-liu/zhi-jie-zhong-lu-you-dao-jiao-yi-chang-suo.md).

# 直接重路由到交易场所

要将每一笔历史成交与某个交易场所在赢得该 swap 时的成交结果进行比较，请使用 [`sim run` 命令](/documentation/developer-docs-zh/liu-cheng/zhong-fang-shi-chang.md)，将重路由模式设为 `venue`，并提供一个模板文件。模板定义了模拟器如何与该交易场所集成，以及要包含哪个交易对。

```bash
sim run \
  --start-slot 400000000 \
  --end-slot 400010000 \
  --reroute-order-flow venue \
  --venue-templates <FILE>
```

<details>

<summary>template.json</summary>

```json
[
  {
    "label": "pool/my-pool/usdc-to-token",
    "mode": "ExactIn",
    "inputMint": "<USDC>",
    "outputMint": "<TOKEN>",
    "instruction": {
      "programId": "<PROGRAM_ID>",
      "accounts": [
        {"address": "<SIGNER>", "writable": true, "signer": true},
        {"address": "<ADDRESS_A>", "writable": true},
        {"address": "<ADDRESS_B>", "writable": true},
        {"address": "<POOL_ADDRESS>", "writable": true},
        {"address": "<VAULT_A>", "writable": true},
        {"address": "<VAULT_B>", "writable": true}
      ],
      "data": {"data": "<ENCODED_SWAP_INSTRUCTION>", "encoding": "base64"}
    },
    "amountOffset": 8,
    "taker": {"user": [0], "inputTokenAccount": 1, "outputTokenAccount": 2}
  }
]
```

</details>

这能显示该交易场所在价格上是否会赢，但不能显示路由器是否真的会把该 swap 路由给它。

这种模式通常用于 DEX 尚未接入任何聚合器的情况，但也适合在不受聚合器路由决策影响的前提下，比较交易场所报价的竞争力。换句话说，它反映的是 *“真实的现实”*，而不是 *“路由器眼中的现实”*。
