For the complete documentation index, see llms.txt. This page is also available as Markdown.

Transaction Safety

A quote, an allowance, a signature and a transaction receipt establish different facts. A safe integration checks each stage before moving to the next.

Validation layers

Layer
Checks
Does not establish

ApiClient

HTTP status, application envelope and response shape

Complete executable-plan validity

ArcClient

Configured router, roles, tokens, amounts, fee arithmetic, deadlines, hashes, signature consistency and decoded calldata

Current balance/allowance or future chain state

eth_call

Whether the transaction executes against the simulated state

That it will succeed after the market changes

Execution Router

Authorized signer, plan and route bindings, nonces, roles and actual settlement

A successful wallet UI or pending hash is not its final result

Receipt check

Whether the mined transaction succeeded

A mined reverted transaction is not a completed swap

The SDK recovers the aggregator signature against the signer identified by the response; the contract enforces which signers are authorized. Do not treat signature consistency alone as a complete on-chain authorization check.

Confirm and reuse the result

The Direct swap() response contains both the quote and transaction. Show its net expected output and signed minimum before confirmation, then authorize and submit that same result. For delegated swaps, show the prepared quote and raw.amount_out_min before the payer signs; build must retain the prepared terms.

Bind confirmation to the complete order and result, including tokens, input amount, accounts, recipient, routing, network, fees and slippage. A changed or expired result requires a new confirmation. See Slippage.

Preserve the prepared result

Retain the full prepared object, including constraints and raw. Approval, signing and build methods validate detached snapshots so an asynchronous wallet operation cannot silently change the terms being signed. Changing fields manually invalidates these protections.

Direct results and completed delegated builds contain decoded execution data. Delegated prepare contains a quote summary and authorization without the full route; its pre-signing trust boundary is explained in Delegated Swaps.

Inspect transaction data

SwapTxRequest uses bigint for value, optional gas and optional gasPrice. A ready execution transaction also includes entrypoint: "executePlan" and amountOutMin: bigint.

execution.plan contains version/signerVersion, chainId/router, payer/executor/recipient, tokenIn/tokenOut, funding/native modes, amountIn/minAmountOut/expectedAmountOut, quoteId, routeHash, settlementPolicyHash, customFeeBps/customFeeReceiver, deadline and nonce. execution also carries router parameters, logical pool IDs, amount modes and signatures. Treat these fields as inspection results; editing them cannot create a newly authorized plan.

Spender checks

Flow
Approve the input ERC-20 to

Aggregator Direct

prepared.approvalSpender, the configured Execution Router

Aggregator Delegated

Canonical Permit2 0x000000000022D473030F116dDEE9F6B43aC78BA3

Do not approve the MemeHook or use a graduation dependency's Permit2 address for an aggregator swap. Check allowance against the accepted result's input amount and validated spender. Arc supports fixed-input swaps.

Time units and expiry

Value
Unit

quote_ts

Unix milliseconds

deadlineSecs / deadline_secs

Relative seconds requested when preparing

Decoded plan.deadline and Witness deadline

Absolute Unix seconds

API timeout

Milliseconds for fetch and reading the response body

The SDK defaults to 120-second deadlines and a 10,000 ms HTTP timeout. The server can impose stricter limits, especially on delegated artifacts. Relative deadlines are bounded against response-arrival time and must still be live when revalidated.

Check the deadline after any token approval. Direct expiry requires a new swap() result and confirmation; delegated expiry requires a new prepare, confirmation and payer signature. Extending an old JSON field does not extend signed authorization.

Retry boundaries

Requests for an unsigned transaction result may be refreshed with bounded backoff; replacement terms need new acceptance. Cancel stale UI requests. Prepare again after expiry or changed terms. Build retries remain constrained by the same artifact and server attempt limits.

Do not automatically resend a transaction when a wallet or RPC call times out after submission. First inspect the transaction hash, receipt and executor nonce. A fresh quote must not become a second trade while the first transaction is still pending.

Last updated

Was this helpful?