{"uid":"cap_pj26bo40q5ZJUAM8Hz0Y-","slug":"order-book-mid-from-levels-6f0c8e34","name":"Order Book Mid From Levels","description":"Compute mid price from bid/ask top-of-book levels. Call when you have L1 bid and ask and need a mid for marks. Returns mid, spread_abs, and spread_bps 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/ob-mid-from-levels","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"ask":{"type":"number","description":"Best ask price (top of book)"},"bid":{"type":"number","description":"Best bid price (top of book)"}}},"responseSchema":{"type":"json","example":{"ask":100.2,"bid":100,"mid":100.1,"schema":"delx/util-ob-mid-from-levels/v1","spread_abs":0.2000000000000028,"spread_bps":19.98001998002027}},"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_xrajvWm-pNx_dpMPGYAY2","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 mid price, absolute spread, and spread in basis points from L1 bid and ask prices using deterministic local math.","exampleAgentPrompt":"What's the mid price, absolute spread, and spread in basis points for a market where the best bid is 42150.50 and the best ask is 42153.00?","exampleUseCases":[{"title":"Mark price for options settlement","prompt":"I need to compute a mark price for settlement — the best bid is 1845.20 and the best ask is 1847.80. Can you give me the mid, absolute spread, and spread in basis points?"},{"title":"Slippage monitoring for algo trader","prompt":"My algo just captured a bid of 0.9985 and an ask of 1.0015 on a stablecoin pair — what's the mid price and spread in bps so I can log slippage?"},{"title":"Real-time spread dashboard","prompt":"For my dashboard, compute the mid and spread bps for a top-of-book snapshot where bid is 29900.00 and ask is 29904.00."}],"resultDescription":"Returns a JSON object with three fields: mid (the arithmetic midpoint between bid and ask), spread_abs (the absolute difference between ask and bid), and spread_bps (the spread expressed in basis points relative to the mid). All values are deterministically computed with no external data sources.","failureModes":["Missing bid or ask field returns a validation error","Ask price lower than bid price (crossed book) may return unexpected or flagged results","Non-numeric input values cause schema validation failure","Payment failure via x402 prevents endpoint from executing"],"whenToPreferThis":"Choose this endpoint when you already have L1 top-of-book bid and ask prices and need a deterministic, local-math mid price and spread calculation with no API keys, no live market feed, and no external dependencies. Ideal for agents that need a fast, cheap, reproducible mark or reference price for risk, settlement, or display purposes without making additional market data calls.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:39:29.056Z","isFirstParty":false}