{"uid":"cap_6gqP3A5dB3xpxDb4E7Phx","slug":"delx-commerce-execution-quality-vs-twap-calculator-c8a3afd2","name":"Delx Commerce — Execution Quality vs TWAP Calculator","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/exec-quality-vs-twap?utm_source=zero.xyz","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_TWqekW469ZB9dWWQBRJMJ","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":"Computes slippage in basis points by comparing an average fill price against a TWAP benchmark for a given trade side.","exampleAgentPrompt":"I just filled a buy order at an average price of 102.50 and the TWAP benchmark was 102.00 — how many basis points of slippage did I get?","exampleUseCases":[{"title":"Post-trade execution slippage audit","prompt":"We executed a sell order with an average fill of 99.80 and the TWAP was 100.10 — can you calculate how many basis points of slippage we incurred on that sell?"},{"title":"Algorithmic strategy performance review","prompt":"I'm reviewing how our algo performed today: we were buying and got an average fill of 50.75 against a TWAP benchmark of 50.60. What's the slippage in bps?"},{"title":"Real-time agent trade quality check","prompt":"After each trade the agent executes, I want it to immediately check execution quality — we just did a buy with avg fill 1023.40 and TWAP was 1021.00. What's the slippage in basis points?"}],"resultDescription":"Returns a JSON object containing the trade side, the schema identifier (delx/util-exec-quality-vs-twap/v1), and the computed slippage expressed in basis points (e.g. slippage_bps: 50). Positive values indicate adverse slippage; the sign convention follows standard market microstructure convention for the given side.","failureModes":["Missing required fields (side, twap, avg_fill) return a 400-level error","Invalid side value (not 'buy' or 'sell') causes a validation error","Non-numeric twap or avg_fill values cause a schema validation failure","Payment not included or insufficient USDC causes a 402 Payment Required response","Network or infrastructure timeout returns a 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-call computation of execution quality measured in basis points against a TWAP benchmark, without building your own formula. It is ideal for AI trading agents that need verifiable, schema-stamped slippage metrics per trade at near-zero cost ($0.001 USDC). Prefer it over rolling your own math when you need an auditable, schema-versioned result suitable for logging or downstream compliance reporting.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T04:16:41.265Z","isFirstParty":false,"canonicalSlug":"delx-commerce-execution-quality-vs-twap-calculator-c8a3afd2"}