$ man price-impact
/price-impact
PRICE / CALL
$0.005
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarketCATEGORY
uncategorized
STATUS
● live
NAME
price-impact — estimates price impact and slippage for a dex swap before you submit it on-chain
SYNOPSIS
POST https://x402.agentutility.ai/price-impact
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Estimates price impact and slippage for a DEX swap before you submit it on-chain. For a (from_token, to_token, chain), pulls aggregator quotes (LlamaSwap meta-aggregator, free public) at multiple USD sizes and reports per-size effective price + slippage versus the smallest size. Use it as a slippage estimator, swap-size impact check, size-keyed quote, or depth simulation to size a fill.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| from_token | string | 0x-prefixed 20-byte ERC-20 input token. | required |
| to_token | string | 0x-prefixed 20-byte ERC-20 output token. | required |
| chain | string | EVM chain. Default 'base'. enum: base · ethereum · polygon · arbitrum · optimism | optional |
| sizes_usd | array | USD sizes to quote at, sorted ascending. Up to 5. Default [100, 1000, 10000]. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| from_token | string | Source token address (or symbol) being sold in the simulated swap. |
| to_token | string | Destination token address (or symbol) being bought in the simulated swap. |
| chain | string | Chain the quote is sourced on (e.g. ethereum, base, arbitrum). |
| from_usd_price | string | Spot USD price of from_token used to convert requested USD sizes into token amounts. |
| from_decimals | string | ERC-20 decimals of from_token, used to scale amounts passed to the aggregator. |
| quotes | string | Array of per-size entries with USD size, effective price, and slippage versus the smallest probe size. |
| source | string | Aggregator that produced the quotes (LlamaSwap meta-aggregator across DEX routers). |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/price-impact \
-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 price-impact tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- edge-marketdexslippageprice-impactswap-quotedepth-simulationaggregatortrade-sizing
- methods
- POST
- cluster
- edgemarket
- price
- $0.005 USDC per call
ADJACENT — other endpoints in edgemarket
| endpoint | description | price |
|---|---|---|
| agent-card-resolve | Resolves an ERC-8004 agentId to its on-chain owner, agentURI, and agent card JSON. | $0.005 |
| arbitrage-spread | Finds the cross-exchange arbitrage spread for any CoinGecko-listed coin. | $0.005 |
| basename-resolve | Resolves Coinbase Basenames (.base.eth) to Ethereum addresses and back, reading the Base mainnet L2 Resolver on-chain (no gas, no wallet). | $0.005 |
| cid-fetch | Fetches the content behind an IPFS CID and optional path through public gateways, returning text, JSON, or base64 with a 5 MB cap. | $0.005 |
| current-balance | Reads a wallet's current ERC-20 token balance with a read-only balanceOf call on Base, Ethereum, Arbitrum, Optimism, Polygon, BSC, or Ava… | $0.005 |
| defi-yield-pools | Filters and ranks thousands of DeFi yield-bearing pools by APY across every chain DeFiLlama tracks. | $0.005 |
| erc20-balance | Reads an ERC-20 token balance on-chain across any supported EVM chain, including Base, Ethereum, Arbitrum, Optimism, and Polygon. | $0.005 |
| erc20-metadata | Reads ERC-20 token metadata: name(), symbol(), decimals(), and totalSupply() in parallel via public RPC on Base, Ethereum, Arbitrum, Opti… | $0.005 |
SEE ALSO