Syncing
Syncing platform activity…
Agent skillBase + Robinhood Chain

Give your agent the Amplify skill.

Live market data, pool detection and swap quotes for free. Strategy analysis priced per request in USDC. Your agent keeps its own keys the whole time.

Point your agent here

curl -s https://www.amplify0x.xyz/skill.md

8 free endpoints3 paid with x402No API keys

How it works

Three steps from zero to a paid report.

  1. Read the skill

    One markdown file describes every endpoint, parameter and rule.

  2. Call free endpoints

    Market data, pool detection and swap quotes need no account, on Base and Robinhood Chain.

  3. Pay per analysis

    Paid reports settle in USDC on Base through x402. No API keys.

Supported chains

Built for agents on Base and Robinhood Chain.

Agents on either chain get the same free endpoints. Read /api/chains for contract addresses instead of hardcoding them.

Base

x402 settles here
Chain ID
8453
Native
ETH
Wrapped native
0x420000…000006
USI token
0x987603…E25B07
  • Market data
  • Pool detection (V2, V3, V4)
  • Token eligibility
  • x402 payment settlement
Explorer

Robinhood Chain

Pays on Base
Chain ID
4663
Native
ETH
Wrapped native
0x0Bd7D3…AcAD73
HOOD token
0x4B6feB…5A47aC
  • Market data
  • Pool detection (V2, V3, V4)
  • Token eligibility
  • AMP swap quotes with Permit2
  • Paid analysis labelled for this chain
Explorer

Robinhood Chain agents: paid reports settle in USDC on Base, because the x402 facilitator does not support Robinhood Chain. Your wallet address is the same on both chains. Fund it with USDC on Base, pay there, and pass chainId: 4663 so the report is labelled for your chain.

curl · discover chains
curl -s https://www.amplify0x.xyz/api/chains

Free

Read the market without paying.

No authentication. Every response is JSON, and upstream failures return a clear status your agent can retry.

GET/api/chainsFree

Supported chains

Machine-readable list of supported chains: IDs, RPC and explorer URLs, wrapped native token, Uniswap V2, V3 and V4 contract addresses, default token and what each chain supports. Start here.

Returns { chains: [{ id, slug, name, rpcUrls, explorer, wrappedNative, defaultToken, uniswap, capabilities, x402Settlement }], aliases, payment }

Parameters and example

This endpoint takes no parameters.

curl
curl -s "https://www.amplify0x.xyz/api/chains"
GET/api/token/metricsFree

AMP market data

Live price, 24h change, market cap, FDV, volume, liquidity and transaction counts for the AMP token, from its deepest pair.

Returns { token, market: { priceUsd, priceChange24h, marketCap, fdv, volume24h, liquidityUsd, txns24h, buys24h, sells24h }, pair }

Parameters and example
chainbase | robinhoodOptional
Defaults to base.
curl
curl -s "https://www.amplify0x.xyz/api/token/metrics?chain=base"
GET/api/trendingFree

Trending tokens

Tokens ranked by activity across Amplify agents over a rolling window.

Returns { window, tokens: [...] }

Parameters and example
window24h | 7d | 30dOptional
Defaults to 7d. Other values fall back to 7d.
curl
curl -s "https://www.amplify0x.xyz/api/trending?window=24h"
GET/api/platform/statsFree

Platform stats

Aggregate trade counts, active wallets, volume and success rate across the platform. Cached for 60 seconds.

Returns { totalTrades, totalBuys, totalSells, tradesLastHour, tradesLast24h, avgTradesPerHour, activeWallets, totalVolumeEth, volumeEth24h, successRate }

Parameters and example

This endpoint takes no parameters.

curl
curl -s "https://www.amplify0x.xyz/api/platform/stats"
GET/api/token/liquidity/poolFree

AMP pool

Reads the AMP liquidity pool directly from chain. Never cached.

Returns { pool } or { pool: null, error } with status 502 when the read fails

Parameters and example

This endpoint takes no parameters.

curl
curl -s "https://www.amplify0x.xyz/api/token/liquidity/pool"
GET/api/token/eligibilityFree

Token eligibility

Checks whether a token address qualifies for an Amplify agent on a given chain.

Returns Eligibility result. 400 when address is missing, 503 when the check cannot complete.

Parameters and example
address0x addressRequired
Token contract address.
chainIdintegerOptional
Defaults to 4663 (Robinhood Chain).
curl
curl -s "https://www.amplify0x.xyz/api/token/eligibility?address=0xe18cd9fa2a6de180249a20fcbd86511174c3bfbf&chainId=4663"
POST/api/agents/mm/v4-support/detect-poolFree

Pool detection

Finds Uniswap V2, V3 and V4 pools for any token before an operator deploys an agent. Read-only.

Returns { v2, v3, v4 } with existence and pool details per version

Parameters and example
tokenAddress0x addressRequired
Token contract address.
chainId8453 | 4663Optional
Defaults to 8453 (Base).
poolId0x 32-byte hexOptional
Verify a specific V4 pool instead of discovering one.
curl
curl -s -X POST "https://www.amplify0x.xyz/api/agents/mm/v4-support/detect-pool" \
  -H "content-type: application/json" \
  -d '{"tokenAddress":"0xe18cd9fa2a6de180249a20fcbd86511174c3bfbf","chainId":4663}'
POST/api/swap/quoteFree

AMP swap quote

Returns a live Uniswap quote and an unsigned transaction for ETH to AMP or AMP to ETH. The agent signs and broadcasts it with its own wallet.

Returns { inputAmount, outputAmount, minimumOutput, priceImpact, gasFeeUSD, routeString, needsPermit, permitData, swapTransaction }

Parameters and example
chainId4663Required
AMP is only deployed on Robinhood Chain.
fromETH | AMPRequired
Asset being sold.
amountinteger stringRequired
Amount in base units (wei). Must be greater than 0.
swapper0x addressRequired
The wallet that will sign the swap.
slippagenumberOptional
Percent, 0.01 to 50. Default 0.5.
quoteTypeEXACT_INPUT | EXACT_OUTPUTOptional
EXACT_OUTPUT is only valid when from is ETH.
curl
curl -s -X POST "https://www.amplify0x.xyz/api/swap/quote" \
  -H "content-type: application/json" \
  -d '{"chainId":4663,"from":"ETH","amount":"1000000000000000","swapper":"0xYourAgentWallet","slippage":0.5}'
Network
Base mainnet (eip155:8453)
Asset
USDC, scheme exact
Pay to
0x2725069C3494185dCB8B467C0dC8aE7291808BB7
Facilitator
https://facilitator.xpay.sh
POST/api/analysis/simulation$0.10 USDC

Grid simulation

Builds a buy and sell grid from your parameters and summarises exposure, range and risk score.

Returns { product, price, network, readOnly, result: { assumptions, levels, summary } }

Parameters and example
chainId8453 | 4663Optional
Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way.
tokenSymbolstringOptional
Label echoed back in the report. Default TOKEN.
currentPricenumberOptional
Reference price. Default 1.
levelsintegerOptional
Grid levels, 2 to 40. Default 10.
spacingBpsintegerOptional
Spacing between levels in basis points, 5 to 2000. Default 100.
orderSizeEthnumberOptional
ETH per order. Default 0.001.
maxExposureEthnumberOptional
Exposure cap in ETH. Default orderSizeEth x levels.
inventoryTargetPctintegerOptional
Target token inventory, 0 to 100. Default 50.
pauseVolatilityBpsintegerOptional
Volatility pause threshold, 25 to 10000. Default 500.
lookbackDaysintegerOptional
History window, 1 to 365. Default 30.
curl · returns 402 until paid
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/simulation" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
POST/api/analysis/risk-report$0.25 USDC

Risk report

Everything in the simulation plus exposure utilisation, concentration, volatility protection and pass or review checks.

Returns { ..., result: { ..., risk: { score, utilizationPct, concentration, volatilityProtection, checks } } }

Parameters and example
chainId8453 | 4663Optional
Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way.
tokenSymbolstringOptional
Label echoed back in the report. Default TOKEN.
currentPricenumberOptional
Reference price. Default 1.
levelsintegerOptional
Grid levels, 2 to 40. Default 10.
spacingBpsintegerOptional
Spacing between levels in basis points, 5 to 2000. Default 100.
orderSizeEthnumberOptional
ETH per order. Default 0.001.
maxExposureEthnumberOptional
Exposure cap in ETH. Default orderSizeEth x levels.
inventoryTargetPctintegerOptional
Target token inventory, 0 to 100. Default 50.
pauseVolatilityBpsintegerOptional
Volatility pause threshold, 25 to 10000. Default 500.
lookbackDaysintegerOptional
History window, 1 to 365. Default 30.
curl · returns 402 until paid
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/risk-report" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
POST/api/analysis/optimize$0.50 USDC

Strategy optimization

Compares your current grid against a lower-risk version and lists the recommended parameter changes.

Returns { ..., result: { current, optimized, changes } }

Parameters and example
chainId8453 | 4663Optional
Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way.
tokenSymbolstringOptional
Label echoed back in the report. Default TOKEN.
currentPricenumberOptional
Reference price. Default 1.
levelsintegerOptional
Grid levels, 2 to 40. Default 10.
spacingBpsintegerOptional
Spacing between levels in basis points, 5 to 2000. Default 100.
orderSizeEthnumberOptional
ETH per order. Default 0.001.
maxExposureEthnumberOptional
Exposure cap in ETH. Default orderSizeEth x levels.
inventoryTargetPctintegerOptional
Target token inventory, 0 to 100. Default 50.
pauseVolatilityBpsintegerOptional
Volatility pause threshold, 25 to 10000. Default 500.
lookbackDaysintegerOptional
History window, 1 to 365. Default 30.
curl · returns 402 until paid
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/optimize" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
TypeScript · ask, sign, retry
import { x402Client, x402HTTPClient } from '@x402/core/client'
import { registerExactEvmScheme } from '@x402/evm/exact/client'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`)
const client = new x402Client()
registerExactEvmScheme(client, { signer: account, networks: ['eip155:8453'] })
const http = new x402HTTPClient(client)

const url = 'https://www.amplify0x.xyz/api/analysis/risk-report'
const body = JSON.stringify({ tokenSymbol: 'AMP', levels: 10, spacingBps: 100, orderSizeEth: 0.001 })
const headers = { 'content-type': 'application/json' }

// 1. Ask. An unpaid request returns 402 with the payment terms.
const first = await fetch(url, { method: 'POST', headers, body })
if (first.status !== 402) throw new Error('Expected 402, got ' + first.status)

// 2. Sign a USDC authorization for exactly those terms.
const terms = http.getPaymentRequiredResponse((name) => first.headers.get(name), await first.clone().json())
const payload = await http.createPaymentPayload(terms)

// 3. Retry with the payment header. Settlement happens before the response.
const paid = await fetch(url, { method: 'POST', headers: { ...headers, ...http.encodePaymentSignatureHeader(payload) }, body })
const report = await paid.json()
const receipt = http.getPaymentSettleResponse((name) => paid.headers.get(name)).transaction

Rules of the road

What an agent should and should not do.

  • Only call the endpoints listed in this skill. Everything under /api/agents/mm except detect-pool controls operator wallets and is not available to agents.
  • Never ask a user for a private key or seed phrase, and never send one to any endpoint. Amplify never needs one from you.
  • Treat the swap quote as a proposal. Show the route, price impact and minimum received to the operator before signing anything.
  • Paid analysis is read-only. It does not trade, approve or move funds, and its output is an estimate, not a profit guarantee.
  • Pay only the amount in the 402 response, only to the pay-to address published in this skill, and only on Base. Robinhood Chain agents use the same wallet address on Base; the facilitator does not settle on Robinhood Chain.
  • Pass the chainId you are evaluating (8453 Base or 4663 Robinhood Chain) to every chain-aware endpoint. Read /api/chains first rather than hardcoding contract addresses.
  • On 4xx responses fix the request. On 5xx or 502 responses wait and retry with backoff. Do not retry a paid request that already settled.

Source

The full SKILL.md.

This is exactly what your agent receives from /skill.md.

Show raw markdown
SKILL.md
---
name: amplify
description: Use Amplify to read market data, detect Uniswap pools, request AMP swap quotes, and buy read-only market-making analysis with x402 micropayments. Works for agents on Base and Robinhood Chain. Use when an agent needs onchain market-making intelligence without handing over keys.
---

# Amplify

Amplify is a non-custodial onchain market-making terminal. This skill covers the parts an autonomous agent can use directly: free read endpoints, unsigned swap quotes, and paid read-only analysis.

Base URL: `https://www.amplify0x.xyz`

## When to use this skill

- You are an agent on Base or Robinhood Chain and need to know what Amplify supports on your chain.
- You need live AMP price, liquidity or volume.
- You need to know whether a token has a usable Uniswap V2, V3 or V4 pool.
- You need a swap quote and unsigned transaction for AMP on Robinhood Chain.
- You want a grid simulation, risk report or optimised strategy before an operator deploys an agent.

## What this skill cannot do

- It cannot create, fund, start, stop or drain market-making agents. Operators do that in the dashboard with their own wallet.
- It does not hold or request keys. Quotes return unsigned transactions that you sign yourself.
- It does not guarantee profit. Analysis is an estimate from the parameters you provide.

## Rules

- Only call the endpoints listed in this skill. Everything under /api/agents/mm except detect-pool controls operator wallets and is not available to agents.
- Never ask a user for a private key or seed phrase, and never send one to any endpoint. Amplify never needs one from you.
- Treat the swap quote as a proposal. Show the route, price impact and minimum received to the operator before signing anything.
- Paid analysis is read-only. It does not trade, approve or move funds, and its output is an estimate, not a profit guarantee.
- Pay only the amount in the 402 response, only to the pay-to address published in this skill, and only on Base. Robinhood Chain agents use the same wallet address on Base; the facilitator does not settle on Robinhood Chain.
- Pass the chainId you are evaluating (8453 Base or 4663 Robinhood Chain) to every chain-aware endpoint. Read /api/chains first rather than hardcoding contract addresses.
- On 4xx responses fix the request. On 5xx or 502 responses wait and retry with backoff. Do not retry a paid request that already settled.

## Supported chains

Amplify supports Base and Robinhood Chain. `GET /api/chains` returns the same data below as JSON, including Uniswap contract addresses.

### Base (`8453`)

- RPC: https://mainnet.base.org, https://base-rpc.publicnode.com
- Explorer: https://basescan.org
- Wrapped native: `0x4200000000000000000000000000000000000006`
- Default token: USI `0x987603A52d8B966E10FBD29DcB1A574049E25B07`
- Supports: Market data, Pool detection (V2, V3, V4), Token eligibility, x402 payment settlement

### Robinhood Chain (`4663`)

- RPC: https://rpc.mainnet.chain.robinhood.com, https://robinhoodchain-rpc.publicnode.com
- Explorer: https://robinhoodchain.blockscout.com
- Wrapped native: `0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73`
- Default token: HOOD `0x4B6feB9dFa3A26ad719dC8d939493E98525A47aC`
- Supports: Market data, Pool detection (V2, V3, V4), Token eligibility, AMP swap quotes with Permit2, Paid analysis labelled for this chain

#### Robinhood Chain agents

- Use `chainId: 4663` on pool detection, eligibility and swap quotes, and `?chain=robinhood` on market data.
- Paid endpoints settle in USDC on Base only, because the x402 facilitator does not support Robinhood Chain. Your EVM address is identical on both chains: fund it with USDC on Base, pay there, and pass `chainId: 4663` so the report is labelled for your chain.
- Chain ID `7887` is a legacy alias for `4663` and still resolves.

## Free endpoints

No authentication and no payment. Responses are JSON.

### Supported chains

`GET /api/chains`

Machine-readable list of supported chains: IDs, RPC and explorer URLs, wrapped native token, Uniswap V2, V3 and V4 contract addresses, default token and what each chain supports. Start here.

No parameters.

```bash
curl -s "https://www.amplify0x.xyz/api/chains"
```

Returns: `{ chains: [{ id, slug, name, rpcUrls, explorer, wrappedNative, defaultToken, uniswap, capabilities, x402Settlement }], aliases, payment }`

### AMP market data

`GET /api/token/metrics`

Live price, 24h change, market cap, FDV, volume, liquidity and transaction counts for the AMP token, from its deepest pair.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `chain` | base | robinhood | no | Defaults to base. |

```bash
curl -s "https://www.amplify0x.xyz/api/token/metrics?chain=base"
```

Returns: `{ token, market: { priceUsd, priceChange24h, marketCap, fdv, volume24h, liquidityUsd, txns24h, buys24h, sells24h }, pair }`

### Trending tokens

`GET /api/trending`

Tokens ranked by activity across Amplify agents over a rolling window.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `window` | 24h | 7d | 30d | no | Defaults to 7d. Other values fall back to 7d. |

```bash
curl -s "https://www.amplify0x.xyz/api/trending?window=24h"
```

Returns: `{ window, tokens: [...] }`

### Platform stats

`GET /api/platform/stats`

Aggregate trade counts, active wallets, volume and success rate across the platform. Cached for 60 seconds.

No parameters.

```bash
curl -s "https://www.amplify0x.xyz/api/platform/stats"
```

Returns: `{ totalTrades, totalBuys, totalSells, tradesLastHour, tradesLast24h, avgTradesPerHour, activeWallets, totalVolumeEth, volumeEth24h, successRate }`

### AMP pool

`GET /api/token/liquidity/pool`

Reads the AMP liquidity pool directly from chain. Never cached.

No parameters.

```bash
curl -s "https://www.amplify0x.xyz/api/token/liquidity/pool"
```

Returns: `{ pool } or { pool: null, error } with status 502 when the read fails`

### Token eligibility

`GET /api/token/eligibility`

Checks whether a token address qualifies for an Amplify agent on a given chain.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `address` | 0x address | yes | Token contract address. |
| `chainId` | integer | no | Defaults to 4663 (Robinhood Chain). |

```bash
curl -s "https://www.amplify0x.xyz/api/token/eligibility?address=0xe18cd9fa2a6de180249a20fcbd86511174c3bfbf&chainId=4663"
```

Returns: `Eligibility result. 400 when address is missing, 503 when the check cannot complete.`

### Pool detection

`POST /api/agents/mm/v4-support/detect-pool`

Finds Uniswap V2, V3 and V4 pools for any token before an operator deploys an agent. Read-only.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `tokenAddress` | 0x address | yes | Token contract address. |
| `chainId` | 8453 | 4663 | no | Defaults to 8453 (Base). |
| `poolId` | 0x 32-byte hex | no | Verify a specific V4 pool instead of discovering one. |

```bash
curl -s -X POST "https://www.amplify0x.xyz/api/agents/mm/v4-support/detect-pool" \
  -H "content-type: application/json" \
  -d '{"tokenAddress":"0xe18cd9fa2a6de180249a20fcbd86511174c3bfbf","chainId":4663}'
```

Returns: `{ v2, v3, v4 } with existence and pool details per version`

### AMP swap quote

`POST /api/swap/quote`

Returns a live Uniswap quote and an unsigned transaction for ETH to AMP or AMP to ETH. The agent signs and broadcasts it with its own wallet.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `chainId` | 4663 | yes | AMP is only deployed on Robinhood Chain. |
| `from` | ETH | AMP | yes | Asset being sold. |
| `amount` | integer string | yes | Amount in base units (wei). Must be greater than 0. |
| `swapper` | 0x address | yes | The wallet that will sign the swap. |
| `slippage` | number | no | Percent, 0.01 to 50. Default 0.5. |
| `quoteType` | EXACT_INPUT | EXACT_OUTPUT | no | EXACT_OUTPUT is only valid when from is ETH. |

```bash
curl -s -X POST "https://www.amplify0x.xyz/api/swap/quote" \
  -H "content-type: application/json" \
  -d '{"chainId":4663,"from":"ETH","amount":"1000000000000000","swapper":"0xYourAgentWallet","slippage":0.5}'
```

Returns: `{ inputAmount, outputAmount, minimumOutput, priceImpact, gasFeeUSD, routeString, needsPermit, permitData, swapTransaction }`

## Paid endpoints (x402)

These use the [x402](https://x402.org) protocol. An unpaid request returns HTTP 402 with the payment terms. You sign a USDC authorization and retry with a payment header. There are no accounts, API keys or subscriptions.

- Network: Base mainnet (`eip155:8453`)
- Asset: USDC
- Pay to: `0x2725069C3494185dCB8B467C0dC8aE7291808BB7`
- Facilitator: https://facilitator.xpay.sh
- Scheme: exact

### Grid simulation ($0.10 USDC)

`POST /api/analysis/simulation`

Builds a buy and sell grid from your parameters and summarises exposure, range and risk score.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `chainId` | 8453 | 4663 | no | Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way. |
| `tokenSymbol` | string | no | Label echoed back in the report. Default TOKEN. |
| `currentPrice` | number | no | Reference price. Default 1. |
| `levels` | integer | no | Grid levels, 2 to 40. Default 10. |
| `spacingBps` | integer | no | Spacing between levels in basis points, 5 to 2000. Default 100. |
| `orderSizeEth` | number | no | ETH per order. Default 0.001. |
| `maxExposureEth` | number | no | Exposure cap in ETH. Default orderSizeEth x levels. |
| `inventoryTargetPct` | integer | no | Target token inventory, 0 to 100. Default 50. |
| `pauseVolatilityBps` | integer | no | Volatility pause threshold, 25 to 10000. Default 500. |
| `lookbackDays` | integer | no | History window, 1 to 365. Default 30. |

```bash
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/simulation" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
```

Returns: `{ product, price, network, readOnly, result: { assumptions, levels, summary } }`

### Risk report ($0.25 USDC)

`POST /api/analysis/risk-report`

Everything in the simulation plus exposure utilisation, concentration, volatility protection and pass or review checks.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `chainId` | 8453 | 4663 | no | Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way. |
| `tokenSymbol` | string | no | Label echoed back in the report. Default TOKEN. |
| `currentPrice` | number | no | Reference price. Default 1. |
| `levels` | integer | no | Grid levels, 2 to 40. Default 10. |
| `spacingBps` | integer | no | Spacing between levels in basis points, 5 to 2000. Default 100. |
| `orderSizeEth` | number | no | ETH per order. Default 0.001. |
| `maxExposureEth` | number | no | Exposure cap in ETH. Default orderSizeEth x levels. |
| `inventoryTargetPct` | integer | no | Target token inventory, 0 to 100. Default 50. |
| `pauseVolatilityBps` | integer | no | Volatility pause threshold, 25 to 10000. Default 500. |
| `lookbackDays` | integer | no | History window, 1 to 365. Default 30. |

```bash
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/risk-report" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
```

Returns: `{ ..., result: { ..., risk: { score, utilizationPct, concentration, volatilityProtection, checks } } }`

### Strategy optimization ($0.50 USDC)

`POST /api/analysis/optimize`

Compares your current grid against a lower-risk version and lists the recommended parameter changes.

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `chainId` | 8453 | 4663 | no | Chain the strategy targets, echoed back in the report. Defaults to 8453 (Base). Payment settles on Base either way. |
| `tokenSymbol` | string | no | Label echoed back in the report. Default TOKEN. |
| `currentPrice` | number | no | Reference price. Default 1. |
| `levels` | integer | no | Grid levels, 2 to 40. Default 10. |
| `spacingBps` | integer | no | Spacing between levels in basis points, 5 to 2000. Default 100. |
| `orderSizeEth` | number | no | ETH per order. Default 0.001. |
| `maxExposureEth` | number | no | Exposure cap in ETH. Default orderSizeEth x levels. |
| `inventoryTargetPct` | integer | no | Target token inventory, 0 to 100. Default 50. |
| `pauseVolatilityBps` | integer | no | Volatility pause threshold, 25 to 10000. Default 500. |
| `lookbackDays` | integer | no | History window, 1 to 365. Default 30. |

```bash
curl -s -X POST "https://www.amplify0x.xyz/api/analysis/optimize" \
  -H "content-type: application/json" \
  -d '{"tokenSymbol":"TOKEN","currentPrice":1,"levels":10,"spacingBps":100,"orderSizeEth":0.001,"maxExposureEth":0.01,"inventoryTargetPct":50,"pauseVolatilityBps":500,"lookbackDays":30}'
```

Returns: `{ ..., result: { current, optimized, changes } }`

### Payment flow

1. Send the request with no payment header. Expect `402` and the terms in the `PAYMENT-REQUIRED` header and body.
2. Sign a USDC `exact` authorization for those terms with the agent wallet. Keep a little ETH on Base only if your wallet type needs gas; the authorization itself is gasless for you.
3. Retry the identical request with the payment signature header. The facilitator settles before the response is returned.
4. Read the settlement transaction from the `PAYMENT-RESPONSE` header and keep it as your receipt.

```ts
import { x402Client, x402HTTPClient } from '@x402/core/client'
import { registerExactEvmScheme } from '@x402/evm/exact/client'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`)
const client = new x402Client()
registerExactEvmScheme(client, { signer: account, networks: ['eip155:8453'] })
const http = new x402HTTPClient(client)

const url = 'https://www.amplify0x.xyz/api/analysis/risk-report'
const body = JSON.stringify({ tokenSymbol: 'AMP', levels: 10, spacingBps: 100, orderSizeEth: 0.001 })
const headers = { 'content-type': 'application/json' }

// 1. Ask. An unpaid request returns 402 with the payment terms.
const first = await fetch(url, { method: 'POST', headers, body })
if (first.status !== 402) throw new Error('Expected 402, got ' + first.status)

// 2. Sign a USDC authorization for exactly those terms.
const terms = http.getPaymentRequiredResponse((name) => first.headers.get(name), await first.clone().json())
const payload = await http.createPaymentPayload(terms)

// 3. Retry with the payment header. Settlement happens before the response.
const paid = await fetch(url, { method: 'POST', headers: { ...headers, ...http.encodePaymentSignatureHeader(payload) }, body })
const report = await paid.json()
const receipt = http.getPaymentSettleResponse((name) => paid.headers.get(name)).transaction
```

## Errors

| Status | Meaning | What to do |
| --- | --- | --- |
| 400 | Invalid parameters | Fix the request. Do not retry unchanged. |
| 402 | Payment required or payment rejected | Follow the payment flow. If rejected, check balance and network. |
| 404 | No route or pair found | Try another amount, chain or token. |
| 502, 503 | Upstream provider unavailable | Retry with exponential backoff. |

## Recommended workflow

1. Call `GET /api/token/metrics` and `GET /api/platform/stats` for context.
2. Call `POST /api/agents/mm/v4-support/detect-pool` for the token you are evaluating.
3. Buy a `risk-report` for the strategy parameters you are considering.
4. If the risk score is `high`, buy `optimize` and compare `current` against `optimized`.
5. Hand the findings to the operator. Do not act on their wallet.

Human-readable version of this skill: https://www.amplify0x.xyz/skill