{"uid":"cap_Zlv1joOfOXWqsWKJnCzN-","slug":"slippage-calculator-expected-vs-actual-fill-ce4288fc","name":"Slippage Calculator (Expected vs Actual Fill)","description":"Slippage between an expected and an actual fill — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/slippage-calc?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"actual":{"type":"string"},"expected":{"type":"string"},"toleranceBps":{"type":"integer","minimum":0}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"slippage-calc","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_efaXULPO4xSbXnDKWmMaM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the slippage between an expected and actual trade fill, optionally checking against a tolerance threshold in basis points","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"DeFi swap slippage audit","prompt":"I just executed a swap — I expected to get 500 USDC but actually received 497.80 USDC. Can you calculate the slippage and tell me if it's within a 25 bps tolerance?"},{"title":"Algo trading fill quality check","prompt":"My trading bot placed an order expecting a fill at 42100.00 and got filled at 42055.50. What's the slippage in basis points and does it exceed a 20 bps threshold?"},{"title":"Pre-trade tolerance validation","prompt":"Before I confirm this trade, can you check if the difference between my quoted price of 3.4510 and the actual execution price of 3.4480 falls within a 15 bps slippage limit?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:16.796Z","isFirstParty":false,"canonicalSlug":"slippage-calculator-expected-vs-actual-fill-ce4288fc"}