{"uid":"cap_04P4KUYMH2Ga_tto2p8qc","slug":"order-book-imbalance-b4dfc638","name":"Order Book Imbalance","description":"Book imbalance (bid_size-ask_size)/(bid_size+ask_size). Call when sizing or signal needs L1 size imbalance. Returns imbalance in [-1,1] 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-imbalance","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"ask_size":{"type":"number","description":"Displayed size at best ask"},"bid_size":{"type":"number","description":"Displayed size at best bid"}}},"responseSchema":{"type":"json","example":{"schema":"delx/util-ob-imbalance/v1","ask_size":8,"bid_size":12,"imbalance":0.2}},"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_didxt4oCeVdJqcAwaXMOc","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 L1 order book imbalance as (bid_size - ask_size) / (bid_size + ask_size), returning a normalized value in [-1, 1]","exampleAgentPrompt":"Calculate the order book imbalance for me — the best bid has a size of 450 and the best ask has a size of 150, give me the normalized imbalance score.","exampleUseCases":[{"title":"Signal generation for directional trade","prompt":"I'm looking at a market where the best bid size is 800 and the best ask size is 200 — can you compute the L1 order book imbalance so I can decide whether to go long?"},{"title":"Position sizing based on book pressure","prompt":"Before I size my next order, I want to know the book imbalance: bid size is 1200 and ask size is 900. Give me the normalized imbalance value between -1 and 1."},{"title":"Real-time book skew monitoring","prompt":"The top of book just updated — bid size is 50 and ask size is 350. What's the imbalance score so I can see how ask-heavy the book is right now?"}],"resultDescription":"A deterministic JSON response containing the imbalance value as a number in the range [-1, 1], where -1 indicates fully ask-dominated, 0 indicates balanced, and +1 indicates fully bid-dominated.","failureModes":["Zero total size (bid_size + ask_size = 0) causes division by zero — endpoint should return an error or null","Negative size values may produce nonsensical results outside [-1, 1]","Missing required fields (bid_size or ask_size) will cause a validation error","Non-numeric inputs will be rejected"],"whenToPreferThis":"Choose this endpoint when you need a fast, cheap, local computation of L1 order book imbalance with no external dependencies, API keys, or live market feed. Ideal for agents that already have bid and ask size data and need a normalized [-1, 1] signal for directional sizing or signal generation without building the math themselves.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:06:36.010Z","isFirstParty":false}