$ man swap-preflight-check
/swap-preflight-check
PRICE / CALL
$0.08
USDC · base mainnet · scheme: exact
──────────────────────────────────────────────────────────────────────────────
NAME
swap-preflight-check — pre-swap safety check for a token pair before you sign: run this as the swap preflight, pre-swap safety, and price impact check an agent…
SYNOPSIS
POST https://x402.agentutility.ai/swap-preflight-check
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION
Pre-swap safety check for a token pair before you sign: run this as the swap preflight, pre-swap safety, and price impact check an agent runs before it commits a trade. Composite: one call runs tx-simulate-swap + price-impact + honeypot-check + dex-liquidity-depth + lp-lock-check in parallel and merges them into one report. Returns a routed swap quote (expected output, min-out at slippage, gas), effective-price impact across a few USD sizes, a honeypot / sell-tax simulation on the token you'd receive, that token's pooled liquidity depth, and a best-effort LP-lock check. Send token_in, token_out, amount (smallest units of token_in), and an optional chain. Different from token-clearance-check: this is scoped to one specific swap you're about to execute, not a general token risk score. Use it as a pre-swap safety API, honeypot-before-swap check, or DEX preflight for trading agents.
INPUT — request schema
| property | type | description | req? |
|---|
| token_in | string | 0x-prefixed 20-byte EVM address of the token you are selling. | required |
| token_out | string | 0x-prefixed 20-byte EVM address of the token you would receive. | required |
| amount | string | Amount of token_in to swap, as a decimal string in smallest units (wei-equivalent). | required |
| chain | string | Optional EVM chain slug: base, ethereum, polygon, arbitrum, or optimism. Default base. | optional |
OUTPUT — response shape
| field | type | description |
|---|
| token_in | string | — |
| token_out | string | — |
| amount_in | string | — |
| chain | string | — |
| simulation | string | — |
| price_impact | string | — |
| honeypot | string | — |
| liquidity_depth | string | — |
| lp_lock | string | — |
| lp_lock_note | string | — |
| note | string | — |
| composed_of | string | — |
| components | string | — |
| degraded | string | — |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/swap-preflight-check \
-H 'Content-Type: application/json' \
-d '{ }'first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster
npx -y @agentutility/mcp-<cluster>
# Required: EVM private key with USDC on Base
export X402_PRIVATE_KEY=0x...
# Then call the swap-preflight-check tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- composeswappreflightcheckswap-preflight-check
- methods
- POST
- cluster
- compose
- price
- $0.08 USDC per call
ADJACENT — other endpoints in compose
| endpoint | description | price |
|---|
| agent-prelaunch-audit | Ship-readiness check before you push an AI app live: agent due diligence and prelaunch audit in one call instead of six. | $0.08 |
| company-intel-pack | Company research bundle for B2B enrichment agents: firmographic profile, domain intelligence, WHOIS registration, TLS posture, tech stack… | $0.08 |
| country-risk-monitor | Re-runnable country monitor: recency-scoped web search headlines, any live Polymarket prediction markets referencing the country (data-on… | $0.08 |
| cyber-exposure-brief | External exposure summary for a domain: DNS records, the hosting network/ASN behind the resolved IP, TLS certificate posture, and a web s… | $0.08 |
| domain-threat-report | Domain threat report API for a security investigation on any domain: is this a phishing domain, a lookalike squat, or a legitimate regist… | $0.08 |
| esg-company-scan | Summary of a company's publicly reported ESG posture: a web search scoped to sustainability/emissions/labor/governance coverage plus a st… | $0.08 |
| image-asset-pipeline | Turns a text prompt into a production-ready image asset in one call: generate, sharpen, cut out the background. | $0.08 |
| meeting-brief | Turns a meeting or call recording into speaker-labeled notes and a summary in one call. | $0.08 |