best-execution

Compare every rail for a lane (JSON body)

Same as the GET form; accepts the RouteRequest body. Read-only.

Includes Robyn's OWN float lane as a ranked candidate, not just third-party bridges. The lane is quoted from inventory Robyn already holds on the destination chain, so it needs no external API and still answers when every aggregator is rate-limited or down. The firstParty block states the first-party price against the best third-party price for that exact request, so the independence claim is checkable per call. Pass excludeRails: ["floatlane"] to compare only third-party rails (used internally when moving Robyn's own inventory, which the lane cannot do).

post/api/route/compare

Request

  • Base URL: https://api.anygas.xyz/svc
  • URL: https://api.anygas.xyz/svc/api/route/compare
  • Auth: none declared

Request body

amountstring required

Source-token smallest units.

fromTokenstring

Symbol or address; omit for native.

toTokenstring

Symbol or address; omit for native.

toAddressstring

Recipient; defaults to fromAddress.

fromAddressstring

Quote origin; anonymous default used if omitted.

slippagenumber

Fraction, e.g. 0.005.

tokenstring

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.

Example request

{
  "amount": "50000000",
  "fromToken": "USDC",
  "toToken": "BTC",
  "token": "USDC"
}

Response

Ranked rails

beststring
comparedRailsinteger
railsAttemptedinteger
cachedboolean

Example response

{
  "best": "allbridge",
  "comparedRails": 2,
  "railsAttempted": 2
}

Changes

No recorded changes to this operation across all 1 revision of this API.