{"openapi":"3.1.0","info":{"title":"Patcha API","description":"Hook simulation, marketplace, CLMM quotes, and Helius DAS proxy.","version":"0.1.0"},"paths":{"/hook/list":{"get":{"tags":["hook"],"summary":"Hook List","description":"Paged marketplace listing.\n\nReads hook_definitions when a database is configured; otherwise returns the\n6 builtin hooks from the in-memory registry (identical metadata).","operationId":"hook_list_hook_list_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Hook List Hook List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hook/{slug}":{"get":{"tags":["hook"],"summary":"Hook Detail","description":"Single hook plus a summary of its most recent backtest runs.","operationId":"hook_detail_hook__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Hook Detail Hook  Slug  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hook/simulate":{"post":{"tags":["hook"],"summary":"Hook Simulate","description":"Deterministic backtest stub.\n\nReturns reproducible, plausible numbers derived from a hash of the request.\nPhase 5/6 replace this with real Orca/Raydium historical-data backtesting;\nthe response shape is the stable contract.","operationId":"hook_simulate_hook_simulate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Hook Simulate Hook Simulate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clmm/quote":{"post":{"tags":["clmm"],"summary":"Clmm Quote","description":"Swap quote with a hook applied vs the no-hook baseline.\n\nPhase 3 returns a deterministic stub; Phase 6 swaps the adapter internals for\nthe real @orca-so/whirlpools-sdk and @raydium-io/raydium-sdk-v2 calls.","operationId":"clmm_quote_clmm_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Clmm Quote Clmm Quote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clmm/pool/{addr}":{"get":{"tags":["clmm"],"summary":"Clmm Pool","description":"Live pool metadata.\n\nWhen Helius is configured, reads the account with a single getAccountInfo and\ndecodes the Orca Whirlpool struct on the server (real mainnet tick / sqrt\nprice / liquidity / fee). Cached for 5 minutes. Falls back to a stub when\nHelius is unset (dev) or the account is not a decodable Whirlpool (e.g. a\nRaydium CLMM pool — real Raydium decoding lives in the TS adapter / SDK-TS).","operationId":"clmm_pool_clmm_pool__addr__get","parameters":[{"name":"addr","in":"path","required":true,"schema":{"type":"string","title":"Addr"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Clmm Pool Clmm Pool  Addr  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/das/asset/{mint}":{"get":{"tags":["das"],"summary":"Das Asset","description":"getAsset for a single mint via Helius DAS.","operationId":"das_asset_das_asset__mint__get","parameters":[{"name":"mint","in":"path","required":true,"schema":{"type":"string","title":"Mint"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Das Asset Das Asset  Mint  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/das/assets-by-owner/{owner}":{"get":{"tags":["das"],"summary":"Das Assets By Owner","description":"getAssetsByOwner for a wallet via Helius DAS.","operationId":"das_assets_by_owner_das_assets_by_owner__owner__get","parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string","title":"Owner"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Das Assets By Owner Das Assets By Owner  Owner  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/overview":{"get":{"tags":["stats"],"summary":"Stats Overview","description":"Install counts and per-DEX breakdown.\n\nAggregates hook_installs when a database is configured; otherwise returns a\ndeterministic stub so the marketplace UI has data in dev.","operationId":"stats_overview_stats_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Stats Overview Stats Overview Get"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"QuoteRequest":{"properties":{"dex":{"type":"string","title":"Dex","description":"'orca' or 'raydium'"},"pool":{"type":"string","title":"Pool"},"amount_in_lamports":{"type":"integer","minimum":1.0,"title":"Amount In Lamports"},"base_mint":{"type":"string","title":"Base Mint"},"hook_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hook Slug"}},"type":"object","required":["dex","pool","amount_in_lamports","base_mint"],"title":"QuoteRequest"},"SimulateRequest":{"properties":{"slug":{"type":"string","title":"Slug"},"params":{"type":"object","title":"Params"},"pool":{"type":"string","title":"Pool"},"dex":{"type":"string","title":"Dex","default":"orca"},"period_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Period Days","default":30}},"type":"object","required":["slug","pool"],"title":"SimulateRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}