# Slippage Calculator (Expected vs Actual Fill)

> Slippage Calculator (Expected vs Actual Fill) is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Calculates the slippage between an expected and actual trade fill, optionally checking against a tolerance threshold in basis points

## Facts

- Endpoint: POST https://twin.unykorn.org/slippage-calc?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/slippage-calculator-expected-vs-actual-fill-ce4288fc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Zlv1joOfOXWqsWKJnCzN-

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 slippage-calculator-expected-vs-actual-fill-ce4288fc -d '<json body>'
```

Example prompt: Calculate the slippage between my expected fill of 1850.25 USDC and my actual fill of 1847.10 USDC, and check whether it's within a 30 bps tolerance.

## When to prefer this

Use this endpoint when you need a lightweight, on-demand computation of trade fill slippage with optional basis-point tolerance checking, especially in automated trading pipelines, DeFi monitoring agents, or post-trade audit workflows. Prefer it over manual calculation when you need a receipt/audit trail of the slippage check with on-chain provenance.

## Known failure modes

- Missing or invalid 'expected' or 'actual' values cause a 400-level error
- Non-numeric strings for expected/actual may result in a parse or validation error
- Negative toleranceBps (below minimum 0) will be rejected by schema validation
- Payment failure or insufficient USDC balance prevents the call from completing
- Network timeout or service unavailability returns a 5xx error

## How this service works

Slippage between an expected and an actual fill — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with an 'ok' boolean, the type identifier 'slippage-calc', and a receipt containing the on-chain transaction hash, USD amount charged, and a unique receipt ID, along with a generated_at ISO8601 timestamp. The core slippage result reflects whether the actual fill deviated from the expected fill within the specified tolerance.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "actual": {
     "type": "string"
    },
    "expected": {
     "type": "string"
    },
    "toleranceBps": {
     "type": "integer",
     "minimum": 0
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "slippage-calc",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/slippage-calculator-expected-vs-actual-fill-ce4288fc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
