{"openapi":"3.1.0","info":{"title":"Market Alpha x402 Signal API","description":"Autonomous AI-agent pay-per-call market intelligence API implementing the x402 v2 HTTP payment protocol (USDC on Base Sepolia / Base Mainnet, optional Circle Gateway Nanopayments dual-rail). Served from a standalone keyless SQLite WAL cache with zero private keys on the API host.","version":"0.2.0","x-x402-provider":{"name":"Market Alpha x402 Signal API","category":"PREDICTION_MARKETS","additionalCategories":["FINANCIAL_ANALYSIS"],"tags":["x402","polymarket","bybit","funding-rates","orderbook","crypto"],"siwx":false,"supportsVanillax402":true,"supportsCircleGateway":true,"payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","network":"eip155:8453"}},"paths":{"/health":{"get":{"tags":["system"],"summary":"Service and SQLite cache health status (Free)","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}},"security":[]}},"/":{"get":{"tags":["discovery"],"summary":"x402 v2 & Circle Agent Marketplace service metadata (Free)","operationId":"service_metadata__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceMetadataResponse"}}}}},"security":[]}},"/.well-known/x402":{"get":{"tags":["discovery"],"summary":"Standard x402 domain discovery manifest (Free)","operationId":"well_known_x402__well_known_x402_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known X402  Well Known X402 Get"}}}}},"security":[]}},"/.well-known/agent.json":{"get":{"tags":["discovery"],"summary":"A2A Agent Card for autonomous agent discovery (Free)","operationId":"well_known_agent_card__well_known_agent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known Agent Card  Well Known Agent Json Get"}}}}},"security":[]}},"/llms.txt":{"get":{"tags":["discovery"],"summary":"Machine-readable AI Agent & LLM service guide (Free)","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}},"security":[]}},"/v1/polymarket/anomalies":{"get":{"tags":["paid-signals"],"summary":"Polymarket orderbook anomalies & resolution-rule clarity ($0.01 USDC)","operationId":"get_polymarket_anomalies_v1_polymarket_anomalies_get","parameters":[{"name":"strategy","in":"query","required":false,"schema":{"anyOf":[{"enum":["ARB_PAIR","HIGH_PROB_CARRY","SPREAD_MAKER","MOONSHOT"],"type":"string"},{"type":"null"}],"description":"Filter by anomaly strategy class.","title":"Strategy"},"description":"Filter by anomaly strategy class."},{"name":"min_edge_pct","in":"query","required":false,"schema":{"type":"number","minimum":0.0,"description":"Minimum expected_edge_pct threshold.","default":0.0,"title":"Min Edge Pct"},"description":"Minimum expected_edge_pct threshold."},{"name":"explicit_rules_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only markets passing automated explicit-rule clarity check.","default":false,"title":"Explicit Rules Only"},"description":"Return only markets passing automated explicit-rule clarity check."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum anomalies to return.","default":50,"title":"Limit"},"description":"Maximum anomalies to return."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolymarketAnomaliesResponse"}}}},"402":{"description":"Payment Required (x402 v2 PAYMENT-REQUIRED header)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-x402":{"x402Version":2,"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"10000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":60,"extra":{"name":"USD Coin","version":"2"}},{"scheme":"exact","network":"eip155:8453","amount":"10000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":604900,"extra":{"name":"GatewayWalletBatched","version":"1","verifyingContract":"0x77777777dcc4d5a8b6e418fd04d8997ef11000ee"}}],"mimeType":"application/json"}}},"/v1/bybit/funding-signals":{"get":{"tags":["paid-signals"],"summary":"Bybit linear perp funding-rate anomalies & multi-TF signals ($0.008 USDC)","operationId":"get_bybit_funding_signals_v1_bybit_funding_signals_get","parameters":[{"name":"symbol","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional exact contract symbol filter (e.g. BTCUSDT, SOLUSDT).","title":"Symbol"},"description":"Optional exact contract symbol filter (e.g. BTCUSDT, SOLUSDT)."},{"name":"min_abs_funding_pct","in":"query","required":false,"schema":{"type":"number","minimum":0.0,"description":"Minimum absolute 8h funding rate (%) filter.","default":0.0,"title":"Min Abs Funding Pct"},"description":"Minimum absolute 8h funding rate (%) filter."},{"name":"active_signals_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only include matrix entries with Buy/Sell directional signals.","default":false,"title":"Active Signals Only"},"description":"Only include matrix entries with Buy/Sell directional signals."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max rows per section.","default":30,"title":"Limit"},"description":"Max rows per section."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BybitFundingSignalsResponse"}}}},"402":{"description":"Payment Required (x402 v2 PAYMENT-REQUIRED header)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-x402":{"x402Version":2,"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"8000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":60,"extra":{"name":"USD Coin","version":"2"}},{"scheme":"exact","network":"eip155:8453","amount":"8000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":604900,"extra":{"name":"GatewayWalletBatched","version":"1","verifyingContract":"0x77777777dcc4d5a8b6e418fd04d8997ef11000ee"}}],"mimeType":"application/json"}}},"/v1/bundle/alpha":{"get":{"tags":["paid-signals"],"summary":"Composite Polymarket + Bybit alpha signal bundle ($0.025 USDC)","operationId":"get_alpha_bundle_v1_bundle_alpha_get","parameters":[{"name":"polymarket_limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":25,"title":"Polymarket Limit"}},{"name":"bybit_limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":15,"title":"Bybit Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleAlphaResponse"}}}},"402":{"description":"Payment Required (x402 v2 PAYMENT-REQUIRED header)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-x402":{"x402Version":2,"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"25000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":60,"extra":{"name":"USD Coin","version":"2"}},{"scheme":"exact","network":"eip155:8453","amount":"25000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x97971682F3723CA013201Ef82B76cfd4e5BAd026","maxTimeoutSeconds":604900,"extra":{"name":"GatewayWalletBatched","version":"1","verifyingContract":"0x77777777dcc4d5a8b6e418fd04d8997ef11000ee"}}],"mimeType":"application/json"}}}},"components":{"schemas":{"BundleAlphaResponse":{"properties":{"feed":{"type":"string","const":"bundle_alpha","title":"Feed","default":"bundle_alpha"},"cached_at":{"type":"string","title":"Cached At"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"},"source_status":{"type":"string","title":"Source Status"},"source_health":{"additionalProperties":{"type":"string"},"type":"object","title":"Source Health"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"polymarket_top_anomalies":{"items":{"$ref":"#/components/schemas/PolymarketAnomalyItem"},"type":"array","title":"Polymarket Top Anomalies"},"bybit_top_funding_anomalies":{"items":{"$ref":"#/components/schemas/BybitFundingItem"},"type":"array","title":"Bybit Top Funding Anomalies"},"bybit_signal_matrix":{"items":{"$ref":"#/components/schemas/BybitSignalMatrixItem"},"type":"array","title":"Bybit Signal Matrix"}},"type":"object","required":["cached_at","cache_age_seconds","source_status"],"title":"BundleAlphaResponse"},"BybitFundingItem":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"Bybit linear perpetual contract symbol (e.g. SOLUSDT)."},"last_price":{"type":"number","title":"Last Price"},"mark_price":{"type":"number","title":"Mark Price"},"bid1":{"type":"number","title":"Bid1"},"ask1":{"type":"number","title":"Ask1"},"turnover_24h":{"type":"number","title":"Turnover 24H","description":"24-hour notional turnover in USDT."},"open_interest_value":{"type":"number","title":"Open Interest Value","description":"Open interest value in USDT."},"price_24h_pcnt":{"type":"number","title":"Price 24H Pcnt","description":"24-hour percentage price change."},"funding_rate_8h_pct":{"type":"number","title":"Funding Rate 8H Pct","description":"Current 8-hour funding rate in percent."},"funding_annualized_pct":{"type":"number","title":"Funding Annualized Pct","description":"Annualized funding carry in percent."},"adverse_funding_flag":{"type":"boolean","title":"Adverse Funding Flag","description":"True when |funding_rate_8h_pct| >= 0.05%."}},"type":"object","required":["symbol","last_price","mark_price","bid1","ask1","turnover_24h","open_interest_value","price_24h_pcnt","funding_rate_8h_pct","funding_annualized_pct","adverse_funding_flag"],"title":"BybitFundingItem"},"BybitFundingSignalsResponse":{"properties":{"feed":{"type":"string","const":"bybit_funding_signals","title":"Feed","default":"bybit_funding_signals"},"cached_at":{"type":"string","title":"Cached At"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"},"source_status":{"type":"string","title":"Source Status"},"total_usdt_perps_scanned":{"type":"integer","title":"Total Usdt Perps Scanned"},"liquid_perps_count":{"type":"integer","title":"Liquid Perps Count"},"active_signal_count":{"type":"integer","title":"Active Signal Count"},"funding_anomalies":{"items":{"$ref":"#/components/schemas/BybitFundingItem"},"type":"array","title":"Funding Anomalies"},"signal_matrix":{"items":{"$ref":"#/components/schemas/BybitSignalMatrixItem"},"type":"array","title":"Signal Matrix"}},"type":"object","required":["cached_at","cache_age_seconds","source_status","total_usdt_perps_scanned","liquid_perps_count","active_signal_count"],"title":"BybitFundingSignalsResponse"},"BybitSignalMatrixItem":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"Bybit linear perpetual contract symbol (e.g. SOLUSDT)."},"last_price":{"type":"number","title":"Last Price"},"mark_price":{"type":"number","title":"Mark Price"},"bid1":{"type":"number","title":"Bid1"},"ask1":{"type":"number","title":"Ask1"},"turnover_24h":{"type":"number","title":"Turnover 24H","description":"24-hour notional turnover in USDT."},"open_interest_value":{"type":"number","title":"Open Interest Value","description":"Open interest value in USDT."},"price_24h_pcnt":{"type":"number","title":"Price 24H Pcnt","description":"24-hour percentage price change."},"funding_rate_8h_pct":{"type":"number","title":"Funding Rate 8H Pct","description":"Current 8-hour funding rate in percent."},"funding_annualized_pct":{"type":"number","title":"Funding Annualized Pct","description":"Annualized funding carry in percent."},"adverse_funding_flag":{"type":"boolean","title":"Adverse Funding Flag","description":"True when |funding_rate_8h_pct| >= 0.05%."},"trend_4h":{"type":"string","enum":["UP","DOWN","CHOP"],"title":"Trend 4H","description":"4H EMA20/50 trend regime."},"ema_sep_pct":{"type":"number","title":"Ema Sep Pct","description":"4H (EMA20 - EMA50) / EMA50 percentage."},"rsi_1h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rsi 1H","description":"1H RSI(14) momentum oscillator."},"atr_1h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Atr 1H","description":"1H ATR(14) volatility measure."},"vol_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vol Ratio","description":"Latest 1H volume divided by 20-bar average."},"signal":{"$ref":"#/components/schemas/PerpTradeSignal"}},"type":"object","required":["symbol","last_price","mark_price","bid1","ask1","turnover_24h","open_interest_value","price_24h_pcnt","funding_rate_8h_pct","funding_annualized_pct","adverse_funding_flag","trend_4h","ema_sep_pct","signal"],"title":"BybitSignalMatrixItem"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PerpTradeSignal":{"properties":{"side":{"type":"string","enum":["Buy","Sell","None"],"title":"Side","description":"Directional signal side."},"score":{"type":"integer","maximum":5.0,"minimum":0.0,"title":"Score","description":"Deterministic signal conviction score (0-5)."},"entry":{"type":"number","title":"Entry","description":"Reference entry price (last price)."},"sl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl","description":"ATR-clamped stop-loss price."},"tp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tp","description":"ATR-derived take-profit price (2.2R)."},"reason":{"type":"string","title":"Reason","description":"Deterministic rule code explaining signal state."}},"type":"object","required":["side","score","entry","reason"],"title":"PerpTradeSignal"},"PolymarketAnomaliesResponse":{"properties":{"feed":{"type":"string","const":"polymarket_anomalies","title":"Feed","default":"polymarket_anomalies"},"cached_at":{"type":"string","title":"Cached At","description":"UTC ISO-8601 timestamp of last cache refresh."},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds","description":"Age of cached snapshot in seconds."},"source_status":{"type":"string","title":"Source Status","description":"Collector upstream status: ok | degraded | error."},"markets_scanned":{"type":"integer","title":"Markets Scanned","description":"Number of active Polymarket markets scanned."},"orderbooks_fetched":{"type":"integer","title":"Orderbooks Fetched","description":"Number of CLOB L2 orderbooks fetched."},"counts_by_strategy":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Strategy"},"total_returned":{"type":"integer","title":"Total Returned","description":"Number of anomaly rows returned after filtering."},"anomalies":{"items":{"$ref":"#/components/schemas/PolymarketAnomalyItem"},"type":"array","title":"Anomalies"}},"type":"object","required":["cached_at","cache_age_seconds","source_status","markets_scanned","orderbooks_fetched","total_returned"],"title":"PolymarketAnomaliesResponse"},"PolymarketAnomalyItem":{"properties":{"strategy":{"type":"string","enum":["ARB_PAIR","HIGH_PROB_CARRY","SPREAD_MAKER","MOONSHOT"],"title":"Strategy","description":"Detected deterministic orderbook anomaly strategy class."},"market_id":{"type":"string","title":"Market Id","description":"Polymarket Gamma market ID."},"event_slug":{"type":"string","title":"Event Slug","description":"Polymarket event slug."},"question":{"type":"string","title":"Question","description":"Prediction market question."},"outcome":{"type":"string","title":"Outcome","description":"Outcome label (e.g. Yes, No, or Yes+No)."},"token_id":{"type":"string","title":"Token Id","description":"Polymarket CLOB ERC-1155 token ID."},"best_bid":{"type":"number","title":"Best Bid","description":"Top-of-book best bid price (0..1)."},"best_ask":{"type":"number","title":"Best Ask","description":"Top-of-book best ask price (0..1)."},"suggested_entry":{"type":"number","title":"Suggested Entry","description":"Indicative maker/taker entry price."},"spread":{"type":"number","title":"Spread","description":"Best ask minus best bid."},"bid_depth_usdc":{"type":"number","title":"Bid Depth Usdc","description":"Top-5 bid levels depth in USDC."},"ask_depth_usdc":{"type":"number","title":"Ask Depth Usdc","description":"Top-5 ask levels depth in USDC."},"expected_edge_pct":{"type":"number","title":"Expected Edge Pct","description":"Estimated gross edge percentage."},"yield_per_day_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Yield Per Day Pct","description":"Estimated daily carry yield (%) when endDate is known."},"days_to_end":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Days To End","description":"Days remaining until market endDate."},"volume_24h":{"type":"number","title":"Volume 24H","description":"24-hour market volume in USD."},"liquidity":{"type":"number","title":"Liquidity","description":"Reported market liquidity in USD."},"rules_has_explicit_criteria":{"type":"boolean","title":"Rules Has Explicit Criteria","description":"True if regex check found explicit oracle/cutoff without ambiguity traps."},"rules_warning":{"type":"string","title":"Rules Warning","description":"Warning flags from automated resolution-rule clarity screening.","default":""}},"type":"object","required":["strategy","market_id","event_slug","question","outcome","token_id","best_bid","best_ask","suggested_entry","spread","bid_depth_usdc","ask_depth_usdc","expected_edge_pct","volume_24h","liquidity","rules_has_explicit_criteria"],"title":"PolymarketAnomalyItem"},"ServiceMetadataResponse":{"properties":{"service":{"type":"string","title":"Service"},"version":{"type":"string","title":"Version"},"x402Version":{"type":"integer","title":"X402Version","default":2},"middleware_mode":{"type":"string","title":"Middleware Mode"},"siwx":{"type":"boolean","title":"Siwx","default":false},"supportsVanillax402":{"type":"boolean","title":"Supportsvanillax402","default":true},"supportsCircleGateway":{"type":"boolean","title":"Supportscirclegateway"},"network":{"type":"string","title":"Network"},"asset":{"type":"string","title":"Asset"},"payTo":{"type":"string","title":"Payto"},"facilitatorUrl":{"type":"string","title":"Facilitatorurl"},"openApiUrl":{"type":"string","title":"Openapiurl","default":"/openapi.json"},"healthUrl":{"type":"string","title":"Healthurl","default":"/health"},"endpoints":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Endpoints"}},"type":"object","required":["service","version","middleware_mode","supportsCircleGateway","network","asset","payTo","facilitatorUrl","endpoints"],"title":"ServiceMetadataResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"https://api.koxu.win"}]}