Skip to main content
Glama

arcgate

tradeQuote

Prices a swap between sell and buy across the indexed venues and stores it under a quoteId.

  • Cost: 0.01 USDC per call over x402: the first call gets a 402 with payment requirements in the PAYMENT-REQUIRED header (base64 JSON); sign them and retry with a PAYMENT-SIGNATURE header carrying the payment payload.

  • sell / buy: two different assets (native and ERC-20 USDC count as the same asset; either side may be USDC). Resolve a ticker with POST /trade/v1/search first.

  • Response shape: when one side is USDC, best.type is direct/two_hop/split and best.legs lists one leg per path actually used; routes[] lists every discovery candidate. When neither side is USDC, or when a USDC-side allocation can't be expressed as legs, best.type is graph, best.legs is empty, and the execution plan is in best.graph. Both shapes support side: exactIn and exactOut, and both execute the same way through POST /trade/v1/swap.

  • amount: a human-readable decimal string in the token's own units, e.g. "1.5" for 1.5 USDC, not base units. It is the sell amount for side: exactIn and the buy amount for side: exactOut.

  • Optional: side (exactIn/exactOut), slippageBps, split and hop limits, venues/excludeVenues (ids from GET /trade/v1/venues), taker, ttlSec.

  • Executability: POST /trade/v1/swap executes every quote through ArcgateRouter. best.executable is false, with warning graph_execution_unavailable, when no ArcgateRouter is configured (or, for an Aerodrome edge, no Aerodrome router), or when the operator has disabled a selected path's venue - even with both routers configured. In that last case, POST /trade/v1/swap may still fall back to an executable candidate the quote already priced instead of failing outright.

  • Readiness: name the wallet that will trade in taker and the answer carries readiness, read at the quote's block: whether that wallet holds the input (balance), which approval or Permit2 signature POST /trade/v1/swap will need (approval for the default permit2, approve for approval: "approve"), enough native USDC for gas (gas), and whether this call's x402 payer can pay the swap fee (fees). totalCostUsdc is the swap fee plus gas: what finishing costs. When ready is false, next is stop. Without taker there is no readiness.

  • Lifetime: the quoteId is good for ttlSec seconds (default and max 120).

  • Next: POST /trade/v1/swap with the returned quoteId. Costs 10000 base units (0.01 USDC) per call. Payment goes in params._meta["x402/payment"]; use an x402-aware MCP client (see https://docs.arcgate.dev/#arcgate/description/mcp-for-agents).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyYes
sellYes
sideNoexactIn
takerNo
amountYes
ttlSecNoHow long the stored quote (and this response's expiresAt) stays live, in seconds (1-120, default 120). A caller may shorten it to re-quote sooner; it can never lengthen past 120s. Safe to shorten or leave at default: POST /trade/v1/swap always re-quotes and re-simulates at the current block and 409s quote_stale below the stored minAmountOut, so this bounds staleness risk, not price risk. The on-chain execution deadline is a separate parameter (deadlineSec, POST /trade/v1/swap).
venuesNo
maxHopsNo
sourcesNo
maxSplitsNo
allowSplitsNo
slippageBpsNo
excludeVenuesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources