{"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":"Backtest a hook against real mainnet pool history.\n\nFetches the pool's recent swaps via Helius, reconstructs price/volume by\nmatching vault transfers, and runs the hook's simulation on measured data.\nFalls back to a clearly-flagged deterministic stub when live data isn't\navailable. Result cached 1h; underlying swap history cached 12h.","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"}}}}}}},"/keeper/status":{"get":{"tags":["keeper"],"summary":"Keeper Status","description":"This process's keeper state (in-process / on-demand scans).","operationId":"keeper_status_keeper_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Keeper Status Keeper Status Get"}}}}}}},"/keeper/worker":{"get":{"tags":["keeper"],"summary":"Keeper Worker","description":"Live status of the standalone keeper worker (patcha-keeper service),\nread from shared Redis. Confirms the background daemon is scanning.","operationId":"keeper_worker_keeper_worker_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Keeper Worker Keeper Worker Get"}}}}}}},"/keeper/scan":{"post":{"tags":["keeper"],"summary":"Keeper Scan","description":"Scan a pool's recent real swaps and return the hook triggers that fired.\n\nWith no `hooks`, evaluates the three post-hoc enforceable hooks\n(DynamicFee / AntiMEV / RangeOrder) at default params.","operationId":"keeper_scan_keeper_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Keeper Scan Keeper Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/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"},"HookInstall":{"properties":{"slug":{"type":"string","title":"Slug"},"params":{"type":"object","title":"Params"}},"type":"object","required":["slug"],"title":"HookInstall"},"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"},"ScanRequest":{"properties":{"pool":{"type":"string","title":"Pool","default":"Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"},"hooks":{"anyOf":[{"items":{"$ref":"#/components/schemas/HookInstall"},"type":"array"},{"type":"null"}],"title":"Hooks"}},"type":"object","title":"ScanRequest"},"SimulateRequest":{"properties":{"slug":{"type":"string","title":"Slug"},"params":{"type":"object","title":"Params"},"pool":{"type":"string","title":"Pool","default":"Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"},"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"],"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"}}}}