{"uid":"cap_5VFnXWQb2TiS4r-OBdqXD","slug":"onesource-deepstate-market-cost-to-quote-analytics-0c555191","name":"OneSource Deepstate Market Cost-to-Quote Analytics","description":"Deepstate, the on-chain order-book exchange on Robinhood Chain. Gas spent resting and cancelling orders for a market.","url":"https://api.onesource.io/deepstate/v1/analytics/cost-to-quote","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["book"],"properties":{"to":{"type":"string"},"res":{"enum":["1h","1d"],"type":"string"},"book":{"type":"string"},"from":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"to":{"type":"string"},"from":{"type":"string"},"totals":{"type":"object","properties":{"rests":{"type":"integer"},"cancels":{"type":"integer"},"tx_count":{"type":"integer"},"l1_fee_raw":{"type":"string"},"l1_share_pct":{"type":"number"},"total_fee_raw":{"type":"string"},"median_fee_raw":{"type":"string"}}},"book_id":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"rests":{"type":"integer"},"bucket":{"type":"string"},"cancels":{"type":"integer"},"tx_count":{"type":"integer"},"l1_fee_raw":{"type":"string"},"l1_share_pct":{"type":"number"},"total_fee_raw":{"type":"string"},"market_session":{"type":"string"},"median_fee_raw":{"type":"string"}}}},"book_slug":{"type":"string"},"book_label":{"type":"string"},"resolution":{"type":"string"}},"description":"Endpoint-specific response payload"}}}}},"responseSchema":{"type":"json","example":{"to":"2026-09-02T16:00:00Z","from":"2026-09-02T14:00:00Z","totals":{"rests":427,"cancels":385,"tx_count":790,"l1_fee_raw":"19018200000000000","l1_share_pct":18.99,"total_fee_raw":"100178400000000000","median_fee_raw":"119700000000000"},"book_id":"0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399","buckets":[{"rests":219,"bucket":"2026-09-02T14:00:00Z","cancels":198,"tx_count":402,"l1_fee_raw":"9186100000000000","l1_share_pct":18.75,"total_fee_raw":"48973600000000000","market_session":"regular","median_fee_raw":"118000000000000"}],"book_slug":"NVDA-USDG","book_label":"NVDA/USDG","resolution":"1h"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0yWcHXNkzPwA8lezq_SSf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns gas cost analytics (fees, rests, cancels) for resting and cancelling orders on a Deepstate order book market, bucketed by time period","exampleAgentPrompt":"Can you pull the gas cost analytics for Deepstate order book 'ETH-USDC' from January 1 to January 31, broken down by 1-hour buckets, so I can see how much was spent on rests and cancels?","exampleUseCases":[{"title":"Daily gas cost review for a trading book","prompt":"Show me the total gas fees spent on rests and cancels for Deepstate book 'BTC-USDC' yesterday, bucketed by 1-day resolution — I want to see the L1 fee share and median fee too."},{"title":"Hourly fee spike investigation","prompt":"Something spiked our order costs last Tuesday — can you pull hourly gas analytics for Deepstate book 'ETH-USDC' from 2024-01-09 to 2024-01-10 so I can see which hour had the highest fees?"},{"title":"Market session cost comparison","prompt":"I want to compare gas costs across different market sessions for Deepstate book 'SOL-USDC' over the past week — can you grab the cost-to-quote data with 1-hour resolution from Jan 20 to Jan 27?"}],"resultDescription":"Returns aggregated gas cost metrics for the specified order book and time range, including: total fee, median fee, L1 fee, L1 share percentage, rest count, cancel count, and transaction count — both as overall totals and broken down into time buckets (1h or 1d) with market session labels.","failureModes":["Missing required 'book' query parameter returns a 400 error","Invalid 'res' enum value (not '1h' or '1d') returns a validation error","Invalid or non-existent book ID returns empty or error response","Date range with no data returns empty buckets or zero totals","Payment failure or missing x402 payment header returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need gas cost analytics specifically for a Deepstate order book market — it provides granular fee breakdowns (L1 vs total, rests vs cancels) with time-bucketed aggregations that generic EVM RPC endpoints cannot supply. Prefer this over raw RPC calls when you need pre-aggregated cost-to-quote metrics rather than raw transaction data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:46:31.209Z","isFirstParty":false}