---
title: "Why this route won — and what it actually beat"
method: POST
path: "/api/route/why"
tags: ["best-execution"]
---

# Why this route won — and what it actually beat

`POST /api/route/why`

## Request

- Base URL: `https://api.anygas.xyz/svc`
- URL: `https://api.anygas.xyz/svc/api/route/why`
- Auth: none declared

Every router in this space returns a winner. None tells you what it beat, or whether it beat anything at all. "Best route" is presented identically when five rails competed and the cheapest won, and when four rails failed to answer and the survivor was declared best by default — so an agent cannot tell a good price from the only price. This returns the whole decision: every rail that quoted, what each would deliver, the margin the winner won by, and which rails stayed SILENT and why. CHECK `wasCompetitive` BEFORE PRESENTING A PRICE AS GOOD. When false, exactly one rail answered and "best" means "only". Rails listed in `silentRails` did NOT lose — they failed to answer (down, rate-limited, missing credentials) and each carries its reason. Counting silence as defeat is how a router flatters its own coverage. Signed, so the rationale can be archived. Silent rails are CLASSIFIED: `status:"not-configured"` (missing credentials — will never recover on retry, needs an operator) versus `status:"degraded"` (rate limit or cooldown — may self-heal). Each carries `recoversOnRetry` and a `remedy`.

## Request body

- RouteRequest
  - `fromChain` union, required: Source node: EVM chain id or one of "solana"/"stellar"/"bitcoin".
    - string
    - integer
  - `toChain` union, required: Destination node.
    - string
    - integer
  - `amount` string, required: Source-token smallest units.
  - `fromToken` string: Symbol or address; omit for native.
  - `toToken` string: Symbol or address; omit for native.
  - `toAddress` string: Recipient; defaults to fromAddress.
  - `fromAddress` string: Quote origin; anonymous default used if omitted.
  - `slippage` number: Fraction, e.g. 0.005.
  - `token` string: Shorthand: sets BOTH fromToken and toToken (e.g. "USDC"). Accepted on POST bodies and as a GET query parameter. Explicit fromToken/toToken win when present.

## Response `200`

Signed rationale: chosen, runnerUp, margin, candidates, silentRails, wasCompetitive

- object

## Other responses

- `502`: Comparison unavailable

---

[API](https://skmtc.dev/anygas/apis/robyn-anygas-api.md) · [All operations](https://skmtc.dev/anygas/apis/robyn-anygas-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anygas/apis/robyn-anygas-api/revisions/9b7498be8304?raw)
