{"uid":"cap_xf2tjAhRFS88E9bsgTIqw","slug":"execution-quality-vs-twap-23198770","name":"Execution Quality vs TWAP","description":"Compare average fill to TWAP benchmark (bps). Call when post-trade quality vs a caller-supplied TWAP. Returns slippage_bps_vs_twap as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/exec-quality-vs-twap","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"side":{"type":"string","description":"Trade side: buy or sell"},"twap":{"type":"number","description":"TWAP benchmark price"},"avg_fill":{"type":"number","description":"Average fill price"}}},"responseSchema":{"type":"json","example":{"side":"buy","schema":"delx/util-exec-quality-vs-twap/v1","slippage_bps":50}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LdkN7SC1d13jkhEYO4iCh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares an average fill price against a caller-supplied TWAP benchmark and returns the slippage in basis points","exampleAgentPrompt":"I bought ETH with an average fill of 3452.10 and the TWAP benchmark was 3448.50 — can you compute the execution slippage in basis points versus TWAP?","exampleUseCases":[{"title":"Post-trade buy order quality check","prompt":"My buy order filled at an average price of 65,200 and the TWAP over that window was 65,150 — how many basis points did I slip versus TWAP?"},{"title":"Sell order TWAP benchmark evaluation","prompt":"I sold a position with an average fill of 1.842 and the TWAP was 1.855 — calculate my execution quality in bps versus TWAP for a sell."},{"title":"Execution quality reporting for algo audit","prompt":"For our post-trade report: it was a buy side order, average fill was 0.9985 and TWAP was 1.0012. What's the slippage in basis points relative to TWAP?"}],"resultDescription":"A deterministic JSON object containing slippage_bps_vs_twap — the signed basis-point difference between the average fill price and the caller-supplied TWAP benchmark, indicating how much better or worse the execution was relative to the benchmark.","failureModes":["Missing required fields (side, twap, avg_fill) return a validation error","Invalid trade side string (not 'buy' or 'sell') may cause incorrect sign logic","Zero or negative price values may produce nonsensical bps output","Payment failure via x402 prevents the call from completing"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, local computation of execution quality versus a caller-supplied TWAP — no market data feed or RPC connection needed. Prefer it for post-trade analytics workflows, algo audit logging, or any scenario where you already have the TWAP and average fill and simply need the bps differential calculated reliably and cheaply.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:07:42.858Z","isFirstParty":false}