# AgentPay Pre-Trade Check

> AgentPay Pre-Trade Check is a paid API for AI agents from agentpay.tools, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-16).

Runs a multi-factor pre-trade risk check on a crypto asset covering funding carry, crowding, liquidity, and optional token security before entering a position

## Facts

- Endpoint: POST https://agentpay.tools/tools/pre_trade_check/call
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentpay-pre-trade-check-c8b3319c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fyQRVPYHyTE60FmmDiqCg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentpay-pre-trade-check-c8b3319c -d '<json body>'
```

Example prompt: Before I open a $50,000 long ETH position, run a pre-trade check — I want to see the funding carry, crowding levels, and slippage estimate.

## When to prefer this

Use this endpoint when an AI agent needs to autonomously evaluate trade risk before executing a crypto position — specifically when you want a combined funding carry + crowding + liquidity + optional token security assessment in a single call rather than querying multiple data sources manually. Especially valuable for agents managing real capital that need a quick go/no-go signal before entering perpetual or spot positions.

## Known failure modes

- Unknown or unsupported symbol returns an error or empty factors
- Invalid ERC-20 address causes security scan to fail or be skipped
- Funding rate data temporarily unavailable causes carry factor to be skipped
- Very large position sizes may lack liquidity data for accurate slippage
- Payment not received (x402) results in 402 response and no data returned

## How this service works

Pre-trade risk check for AI agents trading crypto: live orderbook slippage at YOUR size, side-aware funding carry, open-interest crowding, and optional contract security — composed into a single ok/caution/avoid verdict with per-factor reasons and raw data embedded. Answers 'is this trade sane?' before trading, not after. Replaces four API integrations plus the judgment layer.

## Output

Returns a structured verdict (ok, caution, or warning) plus four factor assessments: carry (annualized funding rate, risk level), crowding (long/short ratio, 24h OI change), liquidity (estimated slippage % for the intended size), and an optional GoPlus security scan if a token address was provided.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "parameters": {
   "type": "object",
   "required": [
    "symbol"
   ],
   "properties": {
    "side": {
     "enum": [
      "long",
      "short"
     ],
     "type": "string",
     "description": "Trade direction (funding carry is side-aware; default long)"
    },
    "symbol": {
     "type": "string",
     "description": "Asset to check, e.g. 'ETH', 'BTC', 'SOL'"
    },
    "size_usd": {
     "type": "number",
     "description": "Intended position size in USD (drives the slippage check; default 10000)"
    },
    "token_address": {
     "type": "string",
     "description": "Optional ERC-20 address — adds a GoPlus security scan"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "side": "long",
 "symbol": "ETH",
 "factors": {
  "carry": {
   "level": "caution",
   "reason": "longs paying elevated funding",
   "annualized_pct": 67.9,
   "median_funding_pct": 0.062
  },
  "crowding": {
   "level": "ok",
   "reason": "positioning unremarkable",
   "long_short_ratio": 1.4,
   "oi_change_24h_pct": 3.2
  },
  "security": {
   "level": "skipped",
   "reason": "no token_address provided"
  },
  "liquidity": {
   "level": "ok",
   "reason": "fills within 0.011% of best ask",
   "bucket_usd": 50000,
   "slippage_pct": 0.011
  }
 },
 "verdict": "caution",
 "size_usd": 50000
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentpay-pre-trade-check-c8b3319c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentpay.tools](https://www.zero.xyz/host/agentpay.tools/llms.txt)
