tradeSwap
Turns a stored quote into unsigned transactions for the taker to sign and send. arcgate never signs, broadcasts or holds funds.
Cost: 0.01 USDC to 5 USDC per call by the quote's USD size, paid over x402. A quote with no USD value, or an unknown or expired one, costs the first tier. It is charged once per quote:
tradeSwapTxis free.under $1,000: 0.01 USDC.
$1,000 to $10,000: 0.05 USDC.
above $10,000 up to $100,000: 0.50 USDC.
above $100,000: 5 USDC.
Inputs:
quoteIdandtaker, and optionalrecipient,deadlineSecandapproval. Neverpermit: it belongs totradeSwapTx, and sending it here is 400invalid_request.Returns: unsigned
transactionsto send in order,signatureswhen a Permit2 signature is needed,warningsandnext. Read what you sign.approval: "permit2"can send an unlimited approve of Permit2 that stays after the trade. When every source pool of the route trades native USDC, the swap pays byvalue: no approval, no signature.Errors:
404
quote_not_found: no such quote. Quote again.409
quote_staleor 410quote_expired: the price moved below the storedminAmountOut, or the quote outlived itsttlSec. The answer carries a free freshquotewhen it can be traded. Check its price,safety.verdictandreadiness, then swap itsquoteId.422
insufficient_balance: the taker lacks the input or the native USDC for gas and the fee. Tell the user.422
swap_reverts: the pre-flight simulation reverted. Stop.422
cannot_sell: the token cannot be sold, or its sell tax is at or above 9000 basis points (trade.quote.honeypot_sell_tax_bps). Stop.422
high_tax: the token can be sold, but its sell tax is above 1000 basis points (trade.quote.max_sell_tax_bps). Stop.422
sell_unverified: the quote's sell check could not confirm the token can be sold, or the re-check from the recipient wallet could not. Stop.422
exit_risk_high: the quote was asked withexitRiskstopand the token it buys rated high. The quote's own policy and level decide; nothing is read again. Stop.422
not_executable: no executable route is left. Stop.429
swap_attempts_exhausted: this quote has used its 5 failed calls. Every error counts exceptquote_not_foundandinvalid_request. So does a payment that fails to settle and an answer that is not delivered. Quote again.
Next:
tradeSwapTx: whennextissign_permit, send the signed permit (free).tradeReceipt: whennextissend, confirm the fill once you have sent the transactions.
Costs 0.01 USDC under $1,000; 0.05 USDC from $1,000 to $10,000; 0.50 USDC above $10,000 up to $100,000; 5 USDC above $100,000; the exact amount for your quoteId comes back in the payment-required result. 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 |
|---|---|---|---|
| taker | Yes | The wallet that signs and sends the transactions. It holds the input token. | |
| quoteId | Yes | The quoteId from tradeQuote. A quote lives for its `ttlSec`, at most 120 seconds. | |
| approval | No | `permit2` (default): an unlimited ERC-20 approve of Permit2 when the allowance is short, which stays after the trade, then a Permit2 signature to sign and send to tradeSwapTx. `approve`: at most one exact-amount ERC-20 approve of ArcgateRouter, and no signature. | permit2 |
| recipient | No | The address that receives the output. Defaults to `taker`. | |
| deadlineSec | No | Seconds from now until the swap transaction expires on chain, 10-600 (default 60). |