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

Arc Aggregator HTTP API

Direct HTTP integration

Base URL: https://api.peach.ag/arc — Arc Mainnet, chain ID 5042. Call GET /router/swap once to obtain both the quote and its signed transaction. No separate quote request or quote ID is required for a Direct swap.

Supply from, target, a positive base-unit amount and the actual executor. Use by_amount_in=true, and set slippage_bps and deadline_secs explicitly. payer and recipient default to executor; Direct execution requires payer = executor.

  1. Request /router/swap once. Check the HTTP status and JSON code === 200, then retain the complete data result.

  2. Display data.expect_amount_out (expected net output), data.tx.amount_out_min (signed minimum received), recipient and fees. Wait for the user to accept this result.

  3. Verify the signed plan and calldata against the intended chain, router, token pair, amount, roles, fees and expiry. For ERC-20 input, ensure allowance to the validated Execution Router; confirm any approval receipt.

  4. Simulate and submit the same returned tx.to, tx.data and tx.value from executor. Save the transaction hash and check the receipt. Do not call swap again in the confirmation handler.

An expired result or changed order requires a new swap request and renewed user confirmation. API success means quote and transaction construction; the HTTP API does not sign for the user's wallet or broadcast a transaction.

See Swap for cURL, JavaScript and the complete request/response reference.

Endpoints

Method
Endpoint
Purpose

GET

/router/swap

Direct swap: quote and ready transaction in one response

GET

/router/swap/prepare

Delegated swap: quote, frozen plan and payer signing data

POST

/router/swap/build

Delegated swap: attach the payer signature to the same prepared plan

GET

/router/status

Optional configuration lookup: providers, active chain/router and service settings

Status discovery is initialization or configuration refresh, not an extra quote step for each swap.

Delegated payment

Keep prepare → payer signature → build when payer and executor differ. Call /router/swap/prepare with distinct payer and executor and an explicit recipient. The payer approves the input ERC-20 to canonical Permit2 as needed, reviews the returned quote and authorization, then signs payer_authorization.typed_data.

POST only quote_id and payer_signature to /router/swap/build as JSON. Build preserves the prepared plan and route; it does not search for another quote. Validate the built transaction against the approved terms before the executor submits it. Expired plans require a new preparation and signature. Send signatures only in the POST body and keep them out of logs.

Amounts, tokens and errors

Use ERC-20 token addresses. Arc USDC uses its 6-decimal ERC-20 interface, 0x3600000000000000000000000000000000000000; native-token sentinels and native input/output are unsupported.

Amounts are decimal integer strings in token base units. Use bigint or equivalent arbitrary-precision integers. amount_out is gross output, expect_amount_out is net output after custom fees, and tx.amount_out_min is the signed minimum after fees and slippage. Display the returned minimum directly; do not subtract slippage again.

Check HTTP status and JSON code independently: business errors can arrive with HTTP 200 and no usable data; parsing and gateway errors can have a non-JSON body. See Error Codes. quote_ts uses Unix milliseconds; signed deadlines use Unix seconds. Do not cache swap responses.

Read /router/status when initializing to verify the current network, router and provider set. Keep wallet and RPC on chain 5042. If authentication is required, use your integration's apikey query parameter and protect private credentials on a trusted backend.

Rate limit

The limit is 300 requests per minute, equivalent to 5 requests per second on average. Pace requests accordingly and honor Retry-After when present; this does not establish a separate burst allowance. Historical response examples are illustrative and cannot be submitted as current transactions.

Last updated

Was this helpful?