Pre-trade risk check for AI agents trading crypto: live orderbook slippage at YOUR size, s
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.
10000 (raw units)
price
36
calls / 30d
12
unique payers
2026-09-17
updated
Provider
agentpay.tools · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0xE8B25A72dD6aeF69515452a61AD231C7DF2843b7",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "10000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"description": "Pre-trade risk check for AI agents trading crypto: 'I want to long $X of SYMBOL — is now sane?' Live slippage at your size + side-aware funding carry + OI crowding + optional security scan → one ok/caution/avoid verdict with per-factor breakdown and raw components embedded.",
"info": {
"errors": [
{
"body": {
"error": "<summary>",
"reason": "<machine-readable reason>"
},
"retry": "Re-request the challenge and pay again",
"status": 402,
"when": "No payment attached (this challenge), or the attached payment failed verification: wrong amount/recipient, memo mismatch, expired, or already used (replay)"
},
{
"body": {
"detail": [
{
"loc": [
"body"
],
"msg": "<what is wrong>",
"type": "<error type>"
}
]
},
"retry": "Fix the body and retry with a fresh payment",
"status": 422,
"when": "Request body present but malformed (invalid JSON or wrong field types) WITH a payment header attached — checked BEFORE settlement, so the payment is never consumed. An unpaid malformed request gets the 402, not a 422"
},
{
"body": {
"detail": "Tool '<name>' not found"
},
"status": 404,
"when": "Unknown tool name"
},
{
"body": {
"error": "Rate limit exceeded"
},
"retry": "Back off and retry after a minute",
"status": 429,
"when": "Rate limited (per-IP and per-wallet limits)"
},
{
"body": {
"error": "Tool execution failed",
"payment_status": "refund_pending",
"tool": "<name>"
},
"status": 500,
"when": "Payment settled on-chain but tool execution failed — the payment is marked refund_pending automatically; you are not charged for a failed call"
},
{
"body": {
"detail": "<what is unavailable>"
},
"retry": "Retry shortly",
"status": 503,
"when": "Tool temporarily unavailable, or the gateway cannot persist the challenge (fail-closed)"
}
],
"input": {
"body": {
"parameters": {
"side": "long",
"size_usd": 50000,
"symbol": "ETH"
}
},
"bodyType": "json",
"method": "POST",
"type": "http"
},
"output": {
"example": {
"factors": {
"carry": {
"level": "ok",
"median_funding_pct": 0.01,
"reason": "carry unremarkable"
},
"crowding": {
"level": "ok",
"long_short_ratio": 1.2,
"reason": "positioning unremarkable"
},
"liquidity": {
"level": "ok",
"reason": "fills within 0.001% of best price",
"slippage_pct": 0.001
},
"security": {
"level": "skipped",
"reason": "no token_address provided"
}
},
"side": "long",
"size_usd": 50000,
"symbol": "ETH",
"verdict": "ok"
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"properties": {
"parameters": {
"properties": {
"side": {
"description": "Trade direction (funding carry is side-aware; default long)",
"enum": [
"long",
"short"
],
"type": "string"
},
"size_usd": {
"description": "Intended position size in USD (drives the slippage check; default 10000)",
"type": "number"
},
"symbol": {
"description": "Asset to check, e.g. 'ETH', 'BTC', 'SOL'",
"type": "string"
},
"token_address": {
"description": "Optional ERC-20 address — adds a GoPlus security scan",
"type": "string"
}
},
"required": [
"symbol"
],
"type": "object"
}
},
"type": "object"
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"bodyType",
"body",
"method"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://agentpay.tools/tools/pre_trade_check/call" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://agentpay.tools/tools/pre_trade_check/call");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://agentpay.tools/tools/pre_trade_check/call")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/600.json, and this resource appears in /discovery/resources and /discovery/search.