{"openapi":"3.1.0","info":{"title":"bozBasket Guard API","version":"1.0.0","summary":"Would a fair-value guard let a buy of this xStock through right now, and why?","description":"Read-only. For each xStock on Solana mainnet the API takes a live Jupiter quote for the requested size and the latest Pyth price, and runs both through the guard arithmetic bozBasket's keeper uses. Nothing is signed or bought. A quote is not a fill: ask again right before you swap, and treat `unavailable` as `defer`. Identical requests are cached for 15 seconds; each address may send 60 requests a minute.","license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://boz-basket-web.vercel.app"}],"paths":{"/api/v1/verdict":{"get":{"operationId":"getVerdict","summary":"Guard verdict for xStocks, right now","parameters":[{"name":"symbol","in":"query","required":false,"description":"Comma-separated xStocks or underlying tickers. Supported: TSLAx, QQQx. Default: all.","schema":{"type":"string","examples":["TSLAx","TSLA,QQQ"]}},{"name":"usdc","in":"query","required":false,"description":"Buy size in USDC. The quote, and so the price impact, is for this size.","schema":{"type":"number","minimum":1,"maximum":100000,"default":100}},{"name":"maxStalenessSecs","in":"query","required":false,"description":"Oldest acceptable Pyth publish time, in seconds.","schema":{"type":"number","minimum":0,"maximum":604800,"default":120}},{"name":"maxConfBps","in":"query","required":false,"description":"Widest acceptable Pyth confidence band, in bps of the price.","schema":{"type":"number","minimum":0,"maximum":10000,"default":50}},{"name":"maxDivergenceBps","in":"query","required":false,"description":"Largest acceptable gap between Jupiter's price per share and Pyth, in either direction.","schema":{"type":"number","minimum":0,"maximum":10000,"default":150}},{"name":"minLiquidityUsd","in":"query","required":false,"description":"Smallest acceptable pool liquidity, in USD.","schema":{"type":"number","minimum":0,"maximum":1000000000,"default":500}}],"responses":{"200":{"description":"A verdict per requested xStock.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerdictResponse"}}}},"400":{"description":"A parameter is out of range, or a symbol is not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Pyth or Jupiter could not be reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This deployment is not configured for the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/history":{"get":{"operationId":"getHistory","summary":"Recorded $100 checks, newest first","description":"bozBasket's keeper records a $100 check of each xStock every few minutes, with the default limits.","parameters":[{"name":"symbol","in":"query","required":false,"description":"As for /api/v1/verdict. Default: all.","schema":{"type":"string"}},{"name":"since","in":"query","required":false,"description":"Unix seconds. Default: 24 hours ago.","schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","required":false,"description":"Rows to return.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":288}}],"responses":{"200":{"description":"Recorded checks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryResponse"}}}},"400":{"description":"A parameter is out of range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The history store could not be reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This deployment has no history store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Verdict":{"type":"string","enum":["buy","defer","unavailable"],"description":"`unavailable` means a price source did not answer; treat it as `defer`."},"Reason":{"type":"object","required":["code","name","label"],"description":"The first failing check, in the program's order. 0 OK (Executed); 1 REFERENCE_STALE (Reference price stale); 2 CONFIDENCE_TOO_WIDE (Confidence too wide); 3 MARKET_CLOSED (Market closed); 4 DIVERGENCE (Venue diverged from reference); 5 LOW_LIQUIDITY (Low liquidity); 6 INSUFFICIENT_BALANCE (Insufficient vault balance). Codes 3 and 6 describe a session policy and a plan's vault, so this API never returns them.","properties":{"code":{"type":"integer"},"name":{"type":"string"},"label":{"type":"string"}}},"VerdictResult":{"type":"object","required":["symbol","underlying","mint","pythFeedId","verdict","reason","reference","venue","gapBps","error"],"properties":{"symbol":{"type":"string"},"underlying":{"type":"string"},"mint":{"type":"string"},"pythFeedId":{"type":"string"},"verdict":{"$ref":"#/components/schemas/Verdict"},"reason":{"oneOf":[{"$ref":"#/components/schemas/Reason"},{"type":"null"}]},"reference":{"oneOf":[{"type":"object","required":["price","confBps","publishTime","ageSecs"],"properties":{"price":{"type":"number"},"confBps":{"type":"number"},"publishTime":{"type":"integer"},"ageSecs":{"type":"integer"}}},{"type":"null"}]},"venue":{"oneOf":[{"type":"object","properties":{"source":{"const":"jupiter"},"usdcIn":{"type":"number"},"pricePerShare":{"type":"number","description":"USDC per share, price impact and the issuer's share multiplier included."},"shares":{"type":"number"},"priceImpactBps":{"type":["number","null"]},"route":{"type":["string","null"]},"liquidityUsd":{"type":["number","null"]},"shareMultiplier":{"type":["number","null"]}}},{"type":"null"}]},"gapBps":{"type":["number","null"],"description":"Signed: above zero the pool charges more than Pyth."},"error":{"type":["string","null"]}}},"VerdictResponse":{"type":"object","required":["apiVersion","network","asOf","request","limits","usSession","overall","results"],"properties":{"apiVersion":{"type":"string"},"network":{"const":"solana-mainnet"},"asOf":{"type":"integer","description":"Unix seconds."},"request":{"type":"object","properties":{"symbols":{"type":"array","items":{"type":"string"}},"usdc":{"type":"number"}}},"limits":{"type":"object","properties":{"maxStalenessSecs":{"type":"number"},"maxConfBps":{"type":"number"},"maxDivergenceBps":{"type":"number"},"minLiquidityUsd":{"type":"number"}}},"usSession":{"type":"object","properties":{"open":{"type":"boolean"},"label":{"type":"string"}},"description":"Informational: the guard judges the price, not the calendar."},"overall":{"$ref":"#/components/schemas/Verdict"},"results":{"type":"array","items":{"$ref":"#/components/schemas/VerdictResult"}}}},"HistoryItem":{"type":"object","properties":{"ts":{"type":"integer"},"symbol":{"type":"string"},"verdict":{"$ref":"#/components/schemas/Verdict"},"reasonCode":{"type":["integer","null"]},"gapBps":{"type":["number","null"]},"referencePrice":{"type":["number","null"]},"refAgeSecs":{"type":["integer","null"]},"confBps":{"type":["number","null"]},"pricePerShare":{"type":["number","null"]},"usdcIn":{"type":"number"},"error":{"type":["string","null"]}}},"HistoryResponse":{"type":"object","properties":{"apiVersion":{"type":"string"},"network":{"const":"solana-mainnet"},"since":{"type":"integer"},"count":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["bad_request","rate_limited","upstream_unavailable","not_configured"]},"message":{"type":"string"}}}}}}}}