# XRPL Data Desk – Trade Cost Calculator

> XRPL Data Desk – Trade Cost Calculator is a paid API for AI agents from data.azeronyx.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-31).

Calculates the estimated cost (slippage, fees, and effective price) of executing a buy or sell trade on a specified XRP Ledger market

## Facts

- Endpoint: POST https://data.azeronyx.com/v1/cost?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/xrpl-data-desk-trade-cost-calculator-ffeb6896
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Chayjl1gImNUswCq3gIK2

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 xrpl-data-desk-trade-cost-calculator-ffeb6896 -d '<json body>'
```

Example prompt: What would it cost me to buy 500 SOLO using XRP on the XRP Ledger DEX — can you calculate the trade cost including any slippage for the SOLO/XRP market?

## When to prefer this

Use this endpoint when you need to estimate the real cost — including slippage and fees — of executing a trade on the XRP Ledger decentralized exchange before committing to it. It is ideal for pre-trade analysis, order sizing, and slippage-aware routing on XRPL markets. Prefer this over generic crypto price APIs when you specifically need DEX trade cost simulation on the XRP Ledger rather than a simple mid-market price quote.

## Known failure modes

- Invalid market pair format (not BASE/QUOTE) returns an error — check /v1/markets for valid pairs
- Missing required fields 'side' or 'amount' returns a validation error
- Unknown or illiquid market with insufficient order book depth may return a cost estimate with high slippage or an error
- Invalid 'side' value (not 'buy' or 'sell') returns a bad request error
- Payment failure (x402) if XRP payment is not settled correctly before the call is processed

## How this service works

Live XRP Ledger market data for AI agents, paid per call in XRP. Settled on the XRP Ledger itself; every endpoint independently audited. Information, not advice.

## Output

Returns a structured object containing the estimated total cost of the trade, effective price, slippage details, and fee information for the specified buy or sell order on the given XRPL market pair. See the /v1/sample endpoint for a live example response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "side",
  "amount"
 ],
 "properties": {
  "side": {
   "type": "string",
   "description": "buy or sell the base"
  },
  "unit": {
   "type": "string",
   "description": "base or quote (default base)"
  },
  "amount": {
   "type": "string",
   "description": "how much, in the unit given"
  },
  "market": {
   "type": "string",
   "description": "an XRP Ledger market as BASE/QUOTE (see /v1/markets)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "description": "See https://data.azeronyx.com/v1/sample?path=/v1/cost for a recent example",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/xrpl-data-desk-trade-cost-calculator-ffeb6896/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from data.azeronyx.com](https://www.zero.xyz/host/data.azeronyx.com/llms.txt)
