← all AgentPay tools

orderbook_depth

Get real bid/ask depth and slippage estimates at $10k, $50k, and $250k notional for a trading pair. Returns best bid/ask, spread percentage, and how much slippage to expect at each trade size..

Free data x402 protocol no API key · no wallet

When agents use this

You need to estimate slippage before executing a large trade. Tells you how much a $10k, $50k, or $250k order will move the market.

Parameters

nametyperequireddescription
symbolstringyesTrading pair, e.g. ETHUSDT or BTCUSDT
exchangestringnoExchange to query: binance (default) or bybit

Returns

best_bid, best_ask, spread_pct, depth with slippage_pct at $10k/$50k/$250k notional, per-exchange best prices

Example response

{
  "asset": "ETH",
  "pair": "ETH/USDT",
  "best_ask": 2071.5,
  "best_bid": 2071.2,
  "spread_pct": 0.0145,
  "depth": [
    {
      "notional_usd": 10000,
      "slippage_pct": 0.002,
      "executable": true
    },
    {
      "notional_usd": 50000,
      "slippage_pct": 0.008,
      "executable": true
    },
    {
      "notional_usd": 250000,
      "slippage_pct": 0.031,
      "executable": true
    }
  ],
  "exchanges": [
    {
      "exchange": "Binance",
      "best_ask": 2071.5,
      "best_bid": 2071.2
    },
    {
      "exchange": "Bybit",
      "best_ask": 2071.6,
      "best_bid": 2071.1
    }
  ],
  "source": "binance/bybit"
}

Call it — HTTP (x402)

curl -X POST https://agentpay.tools/tools/orderbook_depth/call \
  -H 'Content-Type: application/json' \
  -d '{"parameters": {"symbol": "Trading pair, e.g. ETHUSDT or BTCUSDT"}, "agent_address": "<your wallet or any identifier>"}'

Call it — Python SDK

from agentpay import quickstart  # pip install agentpay-x402

s = quickstart(max_spend=0.10)   # hard budget cap; mints a wallet, no funding needed
r = s.call("orderbook_depth", {"symbol": "Trading pair, e.g. ETHUSDT or BTCUSDT"})
print(r.data)                    # + r.cost, r.tx, r.network — full receipt

Call it — MCP

npx -y @romudille/agentpay-mcp   # keyless; exposes orderbook_depth to any MCP agent runtime
All tools · x402 delivery scores · Receipt ledger · Guides · llms.txt · AgentPay