tradeQuote
Prices a swap between two different tokens across the indexed venues and stores it under a quoteId.
Cost: 0.01 USDC per call, paid over x402.
Inputs:
sell,buyandamount(required), and optionalside,slippageBps, split and hop limits,venues,excludeVenues,takerandttlSec. Name the wallet that will trade intakerto getreadiness.Returns: the best plan in
best, withroutes,safety,warningsandexpiresAt. Withtaker,readinesssays whether that wallet holds the input, which approvaltradeSwapwill need, whether it can pay gas and the swap fee, and the total cost to finish. ThequoteIdis good untilexpiresAt(ttlSec, at most 120 seconds). Checksafety.verdictbefore you swap.Errors:
400
ticker_not_allowed:sellandbuyare 0x addresses. Resolve a ticker withtradeSearch.400
unsupported_pair:sellandbuymust be different assets.400
unknown_venue: use ids fromtradeVenues.404
token_not_found: no ERC-20 token at that address.422
no_route,insufficient_liquidity,unsupported_venueorbuy_reverts: no tradable route. Stop, or change the trade.
Next:
tradeSwap: turn thequoteIdinto unsigned transactions. Do it whennextisswap.stopmeans the quote cannot be traded, andnextReasonsays why:best.executableis false, the verdict iscannot_sell,high_taxorilliquid,readiness.readyis false, the request askedexitRiskstopand the token you buy rated high (nextReason.codeexit_risk_high;tradeSwaprefuses it with 422), or the sell check wasinconclusivebecause of the token or an unknown cause (nextReason.codesell_unverified;tradeSwaprefuses it with 422, including for a sale into USDC).requotemeans the sell check wasinconclusivebecause it did not finish (a provider error, the call budget, the simulation allowance): quote again shortly, and stop if the second quote also answersrequote.tradeSwapstill accepts arequotequote: on a token output it re-checks the sell from the recipient wallet, serves the swap if that check passes, and answers 503rpc_unavailableif the re-check does not finish; on a USDC or pinned output it serves the swap, because the swap's own simulation is the exit. Aninconclusivequote is still charged. A sell tax above 1000 basis points (trade.quote.max_sell_tax_bps) is ahigh_taxverdict: the sell works, the tax is too high to trade (nextReason.codehigh_tax;tradeSwaprefuses it with 422). A sell tax at or above 9000 basis points (trade.quote.honeypot_sell_tax_bps) is acannot_sellverdict, a honeypot. A tax measured inside the launchpad's launch window readshigh_taxwith alaunch_windowwarning instead, and the check after the window settles it.exitRiskon the response is the stored exit-risk rating of the token you buy, null when you buy USDC or the token has no rating yet. It is separate from the sell-check verdict: it says whether outside buyers got out, from the trading history. A high level adds anexit_risk_highwarning. The request'sexitRiskpolicy iswarnby default and leavesnextalone;stopanswersnext: stopon a high level, and only for the token you buy, so it never blocks selling a token to USDC.
Costs 10000 base units (0.01 USDC) per call. Or send an account's key in the ARCGATE-KEY header on the MCP connection to pay in units instead. 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
| Name | Required | Description | Default |
|---|---|---|---|
| buy | Yes | The token to buy, as a 0x address. Native and ERC-20 USDC are the same asset. It must differ from `sell`; either side may be USDC. | |
| sell | Yes | The token to sell, as a 0x address (a ticker is `ticker_not_allowed`: resolve it with tradeSearch). Native and ERC-20 USDC are the same asset. It must differ from `buy`. | |
| side | No | `exactIn` spends exactly `amount` of `sell`. `exactOut` buys exactly `amount` of `buy`. | exactIn |
| taker | No | The wallet that will trade, as a 0x address. Name it to get `readiness` back for that wallet. | |
| amount | Yes | A positive 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 `exactIn` and the `buy` amount for `exactOut`. | |
| ttlSec | No | How 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). | |
| venues | No | Quote only through these venue ids, from tradeVenues. Null allows every venue. | |
| maxHops | No | The most pools one path may cross (default 2). | |
| sources | No | Where routes come from. The default `native` is arcgate's own indexed venues. Any other source needs `taker`. | |
| exitRisk | No | What a high exit risk on the token you buy does (default `warn`). `warn` adds an `exit_risk_high` warning and leaves `next` as it is. `stop` answers `next: stop` with `nextReason.code` `exit_risk_high`, and POST /trade/v1/swap refuses the quote with 422 `exit_risk_high`. Exit risk is not the sell-check verdict. Only the token you buy counts, so `stop` never blocks selling a token to USDC. | warn |
| maxSplits | No | The most paths one trade may be split across (default 3). | |
| allowSplits | No | Whether the trade may be split across several paths. | |
| slippageBps | No | How far the result may miss the quote, in basis points (default 100). It sets `minAmountOut` for `exactIn` and `maxAmountIn` for `exactOut`. | |
| excludeVenues | No | Venue ids, from tradeVenues, to leave out. |