{
  "openapi": "3.1.0",
  "info": {
    "title": "Stryke API",
    "version": "v2",
    "description": "Market intelligence and execution across 71 chains with live market data — plus holder and security analysis on 29, and non-custodial quotes on 55."
  },
  "servers": [
    {
      "url": "https://api.stryke.gg"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "v2 market-data API (/api/v2/*). Send your key in the X-API-Key header."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "v1 trading & account API (/v1/*). Send your key as Authorization: Bearer <key>."
      }
    }
  },
  "tags": [
    {
      "name": "Tokens",
      "description": "Token data endpoints under /api/v2/tokens. Read-through layer over the market-data layer (market details, price history, recent trades, wallet labels), the metadata service (token metadata, largest accounts), the DEX index (pairs, search, boosts/trending, embeddable charts), and Stryke's on-chain indexer, fronted by an in-process memo cache (Stryke's engine). Also exposes two heavy on-chain analysis engines: Deep Scan (Stryke's engine — a 0-100 higher=safer rug/safety verdict folding ~16 own on-chain layers plus multiple external safety providers) and the Bubble Map entity graph (Stryke's engine — weighted union-find holder/funder graph). All endpoints require the X-API-Key header (validateApiKey) and count against the per-key rate limit (apiLimiter); only the sibling /api/v2/health route is unauthenticated. Mints are validated against base58 regex ^[1-9A-HJ-NP-Za-km-z]{32,44}$. Every successful response is JSON with a top-level success:true; handler errors return success:false with an error string (most upstream failures surface as HTTP 502)."
    },
    {
      "name": "Wallets",
      "description": "Wallet data endpoints — the core of the v2 API for portfolio dashboards, tax tools, and wallet explorers. Mounted at /api/v2/wallets (router built in the API layer, mounted via app.use('/api/v2',...) in the API layer). All endpoints require a valid X-API-Key header (validateApiKey middleware) and count against a per-key rate limit (apiLimiter); only the sibling /api/v2/health route is unauthenticated. Telemetry middleware (Stryke's engine) logs every request — including failed-auth attempts — before auth runs. Address params are validated against a base58 regex /^[1-9A-HJ-NP-Za-km-z]{32,44}$/; invalid addresses return 400 {success:false,error:'invalid wallet'}. Provider-not-configured states return 503. Upstream provider failures are caught and returned as 502 {success:false,error:<msg>}. Data sources: the market-data layer (portfolio, history, trades, activity) and Stryke's node layer (enhanced/parsed transactions, DAS metadata, RPC). The heavy /profile, /wrapped, and /roast endpoints share a 5-minute server-side cache keyed by depth+wallet(+since), set public Cache-Control with stale-while-revalidate, and build on profile.the assembler (≤5 Stryke's node layer enhanced-tx pages + 1 the market-data layer portfolio on a cold cache)."
    },
    {
      "name": "Market & Charts",
      "description": "Macro Solana market data plus every price-history and candle (OHLCV) endpoint. Aggregate 24h DEX activity across Solana (lighthouse), the canonical SOL/USD spot price and its history, and OHLCV / chart data at the token, pool, and market level. Lighter than the per-token intel endpoints — fewer upstream round-trips, longer cache TTLs. Every route is a read-only GET under /api/v2, requires an X-API-Key header, counts against your per-key rate limit, and is served from an in-process TTL+LRU cache with in-flight de-duplication (lighthouse ~5 min, sol-price ~30 s)."
    },
    {
      "name": "Whales",
      "description": "Smart-money / \"whale\" intelligence endpoints under /api/v2/whales. Two operations: (1) bulk-classify a list of wallets into smart-money label tags and known-entity metadata (the market-data layer-derived), and (2) discover whale wallets among a token's on-chain top holders by resolving the top-20 token accounts to owner wallets (the node RPC) and enriching them with the market-data layer labels. No curated/featured list is served — callers supply their own wallet seed lists. Both endpoints require an X-API-Key header (validateApiKey) and count against the shared v2 per-key rate limit (10 requests / 10 seconds, keyed on the X-API-Key header). The /discover/:mint result is memoized in-process for 5 minutes per mint. Both depend on upstream providers (the market-data layer for labels, Stryke's node layer for on-chain data); when a provider key is unconfigured the handler returns 503, and upstream/provider failures surface as 502."
    },
    {
      "name": "Trading",
      "description": "The /api/v2/orders/* limit and DCA routes below are RETIRED and answer 501 orders_retired; /api/v2/swap/* is live. Swap, limit-order, and DCA endpoints backed by Jupiter's lite-api (lite-api.jup.ag). Two API routers — `swap` (mounted at /api/v2/swap) for quote + build, and `orders` (mounted at /api/v2/orders) for limit orders and dollar-cost-average (DCA) positions. Every endpoint returns UNSIGNED base64 transactions where applicable; the caller signs locally with the user's wallet and broadcasts themselves — the API never sees or holds private keys. All responses are wrapped in `{ success: true,... }` on success (the Jupiter upstream payload is spread in, or nested under `quote` for the quote endpoint). Validation failures return HTTP 400 `{ success:false, error }`; any Jupiter upstream non-2xx or timeout is surfaced as HTTP 502 `{ success:false, error }`. All endpoints require the `X-API-Key` header (validateApiKey) and count against the per-key rate limit (apiLimiter: 10 requests / 10s window, keyed by API key). Address fields are validated against a base58 Solana address regex (32-44 chars). Note: the response field names below are Jupiter lite-api passthrough shapes (swap/v1, limit/v2, dca/v1) — they are not remapped by this service."
    },
    {
      "name": "Launches",
      "description": "Recent Solana token launches, proxied through Stryke's on-chain indexer (HTTP GET /v1/indexer/recent-pools on Stryke-trading-api, real-time gRPC-fed). The router exposes a single read endpoint that returns the most recently indexed liquidity pools / launches, optionally filtered by DEX. Results are sorted indexed_at DESC and briefly memoized (5s) per DEX bucket. Mounted at /api/v2/launches."
    },
    {
      "name": "RPC",
      "description": "Generic, read-only Solana JSON-RPC passthrough to Stryke's node layer mainnet, exposed under /api/v2/rpc. It replaces Stryke's previously client-exposed /api/node-rpc proxy: the same allow-list of safe, read-only RPC methods (no transaction submission, signing, or subscriptions), with per-API-key cost attribution of the upstream Stryke's node layer spend via trackedFetch. Accepts a single JSON-RPC call or a batch (max 25), forwards the body verbatim to https://mainnet.node-rpc.com, and pipes back Stryke's node layer's raw status, content-type, and body unchanged. There is exactly one route in the API layer (POST /). The unauthenticated GET /health lives in the API layer, not in this group."
    },
    {
      "name": "Streaming",
      "description": "Realtime WebSocket gateway at wss://api.stryke.gg/api/v2/stream (Stryke's engine), attached to the same HTTP server as the REST API. PAID-TIER-ONLY (the stream gatekeeper in the API layer): a paid Trading-API key (rt_ on tier builder/scale/enterprise) or an operator-granted Data-API key is required; the free/self-registered tier and the public builder key are DENIED at the WS upgrade with 401. One shared reference-counted poller/feed per distinct topic fans live data to every subscriber, so backend load scales with distinct topics, not client count. Two channels: launches (new pools, optional dex filter — free) and token+mint (live per-mint trade tape — counts against the plan topic cap). Per-tier caps: builder 2 conns/2 topics, scale 20/15, enterprise 50/50, internal/data-grant 20/30 (all env-tunable). Global backstops: 500 concurrent connections, 300 distinct topics, 2048-byte messages, 30s heartbeat. All frames are JSON text: welcome / snapshot / update / pong / unsubscribed / error."
    },
    {
      "name": "Account & Keys",
      "description": "Issue and manage API keys via a Solana wallet: register, regenerate, the SIWS sign-in challenge/login, and the developer dashboard (usage, fee-wallet, allowed domains, white-label license)."
    },
    {
      "name": "Recovery (v1)",
      "description": "The v1 token-account recovery API: scan a wallet for closeable/rent-bearing SPL accounts, build a close transaction, confirm it, plus wallet analysis, token info, and aggregate stats."
    },
    {
      "name": "Direct RPC",
      "description": "Solana RPC passthrough: send a signed transaction, check its status, and simulate before sending."
    },
    {
      "name": "System",
      "description": "Service health and status. Unauthenticated — use it for uptime monitoring."
    },
    {
      "name": "Trading API: Trade & Execution",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Build, sign, and broadcast swaps across all supported DEXes plus the on-chain refund/recovery flow. trade scope; per-tenant; supports an idempotency key."
    },
    {
      "name": "Trading API: Wallets",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Custodial trading wallets — create, import, list, rename, switch, withdraw, and migrate. wallet scope; per-tenant."
    },
    {
      "name": "Trading API: Keys & Sessions",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Self-serve API key issuance and wallet sessions. Public surface: a Solana wallet signature is the auth (no bearer key required)."
    },
    {
      "name": "Trading API: Billing & Tiers",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Paid tiers with live SOL quotes, on-chain SOL payment redemption (anti-replay), and stake checks."
    },
    {
      "name": "Trading API: Token Verification",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). The paid 'Verified by Stryke' token badge — status reads (public) and badge purchase."
    },
    {
      "name": "Trading API: Quests",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Multi-tenant quest / engagement campaigns, tasks, verification, status, and leaderboards. quests scope."
    },
    {
      "name": "Trading API: Account & Profile",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). User settings, rewards/XP, invite codes, and support tickets. read scope; per-tenant."
    },
    {
      "name": "Trading API: Fees, PnL & Positions",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Fee accounting, live and historical PnL, and position/trade history. read scope; per-tenant."
    },
    {
      "name": "Trading API: Indexer",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Read-only on-chain token + pool index — metadata, pool params, recent tokens/pools, search, and per-DEX stats."
    },
    {
      "name": "Trading API: Limit Orders & DCA",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Automated limit orders and dollar-cost-averaging schedules. automation scope; per-tenant; supports an idempotency key."
    },
    {
      "name": "Trading API: Copy Trade",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Copy-trading configs, sources, filters, blacklists, and execution stats. automation scope; per-tenant."
    },
    {
      "name": "Trading API: AFK Auto-Buy",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Hands-off auto-buy configs with mint/deployer whitelists, blacklists, sell stages, and smart-wallet rules. automation scope."
    },
    {
      "name": "Trading API: Sniper & Auto-Sell",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). New-launch sniping plus automated take-profit / stop-loss auto-sell. automation scope; per-tenant."
    },
    {
      "name": "Trading API: System",
      "description": "Auth: send your key as `Authorization: Bearer <key>` (the trading API uses Bearer, NOT the X-API-Key header used by the data API). Service health and a per-key usage / quota snapshot."
    },
    {
      "name": "Programs",
      "description": "On-chain program (smart-contract) intel — account, upgrade state, activity, type mix."
    },
    {
      "name": "Positions",
      "description": "DeFi position aggregation across Kamino, Drift, MarginFi, Jupiter Perps."
    },
    {
      "name": "Webhooks",
      "description": "Push delivery the other way round: instead of holding a connection open, you give us an https endpoint and we POST to it when a trade happens. Same tape as the streaming and REST trade endpoints, read through the same function with the same cursor, so all three agree. THE GUARANTEE IS AT-LEAST-ONCE AND UNORDERED, said plainly because it is what you have to build against: every event carries a stable `eventId` that does not change across retries, so dedupe on it, and every event carries its block and log index, so order on those. Every delivery is signed — X-Stryke-Signature is HMAC-SHA256 over `${t}.${rawBody}` under a secret shown exactly once, at creation. The timestamp is inside the signature, so a captured request cannot be replayed; reject anything more than 300 seconds old. Sign the RAW bytes: re-encoding the parsed JSON changes key order and makes valid signatures fail intermittently. Failed deliveries retry at 10s, 1m, 5m, 30m, 2h and 6h and then dead-letter, and 20 consecutive failures switch the subscription off rather than letting a queue grow behind a dead endpoint — GET /{id}/deliveries shows every attempt and why it failed. Targets must be public https: private, loopback, link-local and cloud-metadata addresses are refused at creation and re-checked before every attempt, and redirects are never followed. A new subscription starts from the moment you created it measured in BLOCK time, so the first event arrives once the index has followed past that instant — up to about 90 seconds on Ethereum, because the follower writes in bursts. That opening silence is expected, not a failure. POST /{id}/test queues a synthetic event through the real path, so you can prove your signature verification works immediately, without waiting for a real trade. Like streaming, this is produced from Stryke's own index, so it covers the chains the index follows — GET /api/v2/stream/chains lists them."
    },
    {
      "name": "Streaming (SSE)",
      "description": "Push delivery over Server-Sent Events, fed by Stryke's OWN index rather than by a reseller. That is the whole design: the tape and the candles are already ours, written continuously by the followers, so there is no per-token subscription ceiling and — because the events are stored — a reconnect REPLAYS what was missed instead of jumping to now. Send Last-Event-ID (a browser EventSource does this by itself) or ?cursor= to resume; a cursor older than the resume window answers with a `truncated` event naming the gap rather than silently skipping it. The cost of reading our own tables is that streaming only covers the chains the index follows: GET /api/v2/stream/chains says which, whether each is serving, and how far behind it is. Everywhere else answers 501 with the reason. The candle channel builds the OPEN bar on demand through the same function the roll-up uses, so a forming bar is live rather than waiting for the next roll-up pass."
    },
    {
      "name": "Chain-generic market data",
      "description": "One set of 26 endpoints that works on every chain in the catalog, under /api/v2/chain/{chain}/*. The chain is a required path segment and is never defaulted — pass the Stryke key (eth), an alias (ethereum), an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses. Which endpoints answer on a given chain depends on that chain's measured capabilities: GET /api/v2/chains/{chain} lists them, and an endpoint a chain cannot serve answers 501 with the evidence — never a 200 with empty data. Every 200 carries the same envelope, including a `freshness` block with the upstream data's own age, so a chain whose indexer has fallen behind is visible rather than silently served as current. The existing Solana endpoints under /api/v2/tokens/* and /api/v2/wallets/* are unchanged."
    },
    {
      "name": "Chains (catalog)",
      "description": "The public chain catalog. 118 chains are recognised (106 EVM, 12 non-EVM); 71 carry live market data, 29 add holder and security analysis, and 55 can be quoted (measured 2026-11-08T11:17:00Z). Tiers are MEASURED every six hours, never declared: L0 recognised — the chain is in the catalog seed: identifiers, native asset and explorer are known; L1 priced — a fresh USD price for a known token on this chain — the newest trade observed is under 24 h old; L2 market — a live tape: the newest trade is under 1 h old, and the chain reports 24 h trade activity or a pool that traded within the hour; L3 forensics — tier 2, and a holder-distribution and token-security analysis completed for the probe token; L4 tradeable — tier 1 or better, and a non-custodial swap route can be quoted — through the aggregator layer or a first-party trade service configured for this chain; L5 services — a first-party trade service is configured for this chain and a paid product on it is live. These endpoints need no API key — they are what an integrator reads before deciding whether to integrate."
    },
    {
      "name": "Screener (pairs)",
      "description": "Every DEX pair the index follows, ranked. Price, 5m/1h/6h/24h change, volume, transactions, liquidity, FDV and age — plus the pair's own candles and tape. Served from Stryke's first-party index; no third-party price feed is involved. Ranked lists require a pool whose depth was actually measured, because volume from an unmeasured pool is not trustworthy — see minLiquidityUsd and the volumeTrusted flag on every row."
    },
    {
      "name": "Wallets (first-party)",
      "description": "What an address has actually traded, read from Stryke’s own tape. Positions, current value and average-cost PnL across Ethereum, Base and Solana. Read-only: nothing here holds a key, signs, or moves a balance. Every figure is window-scoped — the raw tape retains 14 days — and each row says whether its position is complete within the window and what share of its trades were priced."
    },
    {
      "name": "Tokens (first-party)",
      "description": "One token across every market it trades in — identity, the price its deepest market sets, cross-pool totals and the market list. Read from Stryke’s own index on Ethereum, Base and Solana; no third-party price feed is involved. The quoted price comes from the deepest pool whose depth was actually MEASURED, and is null when there is none — a price from an unmeasured pool is the exact failure the liquidity floor exists to stop. Read-only: nothing here holds a key, signs, or moves a balance."
    },
    {
      "name": "Trade (Solana + EVM)",
      "description": "One trading contract across Solana and the EVM chains, under /api/v2/trade, with a portable execution vocabulary — execution.{priority, mev, nonce, slippageBps, maxFeeMultiple} plus a per-chain `passthrough`. CUSTODY IS THE AXIS. quote, build and relay never see a private key, and any private-key field in the body (or smuggled through passthrough) is refused with 400 key_on_noncustodial_route before it reaches anything — rotate that key, it crossed the network. send is custodial, first-party only and closed by default. The non-custodial path is: POST /build → sign on your side → POST /relay → GET /tx/{chain}/{hash}. Errors carry a `code` to branch on and an explicit `retryable`; a broadcast that may still land is reported as AMBIGUOUS — reconcile with GET /tx, never re-send. Read GET /api/v2/trade/chains before spending anything: it says which chains can trade now and what each execution mode does on each chain."
    },
    {
      "name": "EVM chains (per-chain reads)",
      "description": "Direct per-chain reads on the EVM chains in the registry, under /api/v2/evm. Read-only: nothing here builds calldata, signs or broadcasts. A separate namespace from the chainless Solana routes on purpose — here the chain is a required path segment and is never defaulted. Prices and quotes are measured on-chain at a stated size (there is no size-free price in an AMM); USD comes from an on-chain quote of the native asset against the chain's verified reference stablecoin, with no external price provider. Every response carries an X-Stryke-Cost-Units header (see GET /api/v2/evm/pricing). For the full chain catalog and what each chain is measured to support, see GET /api/v2/chains; for one surface across every chain, see the chain-generic routes under /api/v2/chain/{chain}."
    },
    {
      "name": "Market services (orders)",
      "description": "Order market services — volume, makers, holders and bump — under /api/v2/services. These are the only /api/v2 endpoints that move a customer's money, and they are a thin proxy over Stryke's single ordering implementation: this API decides no prices, availability or refund amounts itself. A per-customer key is required on every route except /pricing; shared keys cannot own orders (403 shared_key_cannot_own_orders). Every order is scoped to the key that created it — another key's order answers 404, exactly like one that does not exist. Every error carries an explicit `retryable`, and a refusal with `permanent: true` can never succeed on retry. Live today on Solana; GET /api/v2/services/catalog is the authority on what can be ordered right now, and GET /api/v2/chains?capability=services measures it."
    },
    {
      "name": "Usage & credits",
      "description": "What your key — or its whole account — has used, under /api/v2/usage. Every read costs 0 credits. Planned keys need the usage:read scope (403 otherwise) and see their whole account by default (scope=account) or only themselves (scope=key); older keys see their own key only. Responses identify a key by its numeric keyId and an 8-character keyHint, never by the key itself. Each report accepts only its own parameters: any other parameter, a repeated one, or a value over 32 characters is a 400. A store that cannot be read answers 503, never a 200 with zeros. Answers are cached for about 10 seconds per key and parameter set."
    }
  ],
  "paths": {
    "/api/v2/tokens/metadata": {
      "post": {
        "summary": "Batch token metadata",
        "description": "Returns enriched metadata (name/symbol/image/decimals/supply/ownership) for up to 100 SPL mints in one call. Lookup chain: in-process cache -> local the on-chain indexer -> the metadata service for indexer misses.",
        "tags": [
          "Tokens"
        ],
        "operationId": "post-api-v2-tokens-metadata",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "tokens is a map keyed by mint. count = number of resolved mints (Object.keys(tokens).length); mints not found anywhere are simply absent. Each entry: mint, name, symbol, description, image, decimals, supply, ownership, source. source is 'das' for the metadata service-resolved entries (image populated from content.links.image / files cdn_uri), or 'indexer:<source>' for fast-path rows from the local token indexer (description and image always null, plus an extra uri field). Indexer rows are only used when BOTH name and symbol are populated; otherwise the mint falls through to DAS. If Stryke's node layer is not configured, indexer-covered mints are still returned and the rest are absent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "tokens": {
                      "type": "object",
                      "properties": {
                        "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "description": {},
                            "image": {},
                            "decimals": {
                              "type": "number"
                            },
                            "supply": {
                              "type": "string"
                            },
                            "ownership": {},
                            "source": {
                              "type": "string"
                            },
                            "uri": {
                              "type": "string"
                            }
                          }
                        },
                        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "description": {},
                            "image": {
                              "type": "string"
                            },
                            "decimals": {
                              "type": "number"
                            },
                            "supply": {
                              "type": "string"
                            },
                            "ownership": {
                              "type": "object",
                              "properties": {
                                "frozen": {
                                  "type": "boolean"
                                },
                                "owner": {
                                  "type": "string"
                                }
                              }
                            },
                            "source": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 2,
                  "tokens": {
                    "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                      "name": "Bonk",
                      "symbol": "Bonk",
                      "description": null,
                      "image": null,
                      "decimals": 5,
                      "supply": "88846160172790318",
                      "ownership": null,
                      "source": "indexer",
                      "uri": "https://arweave.net/..."
                    },
                    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
                      "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                      "name": "USD Coin",
                      "symbol": "USDC",
                      "description": null,
                      "image": "https://cdn.stryke.gg/img",
                      "decimals": 6,
                      "supply": "5000000000000000",
                      "ownership": {
                        "frozen": false,
                        "owner": ""
                      },
                      "source": "das"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "mints[] required (max 100 valid SPL mints"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream provider error (success:false, error message"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of SPL mint addresses (base58). Invalid mints are filtered out and the list is capped to the first 100 valid mints. If zero valid mints, 400 'mints[] required (max 100 valid SPL mints)'."
                  }
                },
                "required": [
                  "mints"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/tokens/prices": {
      "post": {
        "summary": "Batch token prices",
        "description": "Current price + core market stats for up to 50 mints in a single call. Each mint is fetched (and cached) independently, so a partial set still returns. Cached 30s per mint.",
        "tags": [
          "Tokens"
        ],
        "operationId": "post-api-v2-tokens-prices",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "prices is an object keyed by mint → { mint, priceUsd, marketCap, fdv (fully-diluted valuation), liquidityUsd, volume24h, priceChange24h (24h %) }. count is the number of resolved entries. Mints that fail to resolve upstream are silently omitted from prices (the rest still return); compare the returned keys against your request to detect misses.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "prices": {
                      "type": "object",
                      "properties": {
                        "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "priceUsd": {
                              "type": "number"
                            },
                            "marketCap": {
                              "type": "number"
                            },
                            "fdv": {
                              "type": "number"
                            },
                            "liquidityUsd": {
                              "type": "number"
                            },
                            "volume24h": {
                              "type": "number"
                            },
                            "priceChange24h": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "prices": {
                    "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                      "priceUsd": 0.000004349723058551535,
                      "marketCap": 382777210.0797244,
                      "fdv": 387030958.98624325,
                      "liquidityUsd": 287323.0494573942,
                      "volume24h": 100780.78179913922,
                      "priceChange24h": -2.948352950031966
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "mints[] required (max 50 valid SPL mints"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream market-data error"
          },
          "503": {
            "description": "market provider not configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of SPL mint addresses (base58). Invalid mints are filtered out and the list is capped to the first 50 valid mints. 400 'mints[] required (max 50 valid SPL mints)' if zero valid mints."
                  }
                },
                "required": [
                  "mints"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/tokens/trending": {
      "get": {
        "summary": "Trending tokens feed",
        "description": "Accurate, self-policing multi-window trending from the official the DEX index REST API (boosts/profiles seed + live pair enrichment). Boost-rank primary, h24-volume tiebreak. The FULL ranked set is memoized 60s under a param-independent key; dex/minLiquidityUsd/limit are applied per-request. Carries a freshness stamp.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-trending",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level: success, generatedAt (ms), maxAgeMs:60000, source:'aggregate', count (after filter/slice), tokens[]. Each token: mint, symbol, name, image, priceUsd, priceChange{m5,h1,h6,h24} (m5 often null), volume{m5,h1,h6,h24}, txns{m5:{buys,sells},h1,h6,h24}, liquidityUsd, marketCap, fdv, pairCreatedAt, dex (dexId), pairAddress, labels[], boosts, rank, rankChange1h. rank is gapless over the FULL set (dex/minLiquidity filtering may leave gaps); rankChange1h is null until ≥1h of history. This is a RICHER shape than /tokens/search. VENDOR-NEUTRAL (source:'aggregate'; vendor-CDN image hosts are dropped to null).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "generatedAt": {
                      "type": "number"
                    },
                    "maxAgeMs": {
                      "type": "number"
                    },
                    "source": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "image": {},
                          "priceUsd": {
                            "type": "number"
                          },
                          "priceChange": {
                            "type": "object",
                            "properties": {
                              "m5": {},
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "volume": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "number"
                              },
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "txns": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h1": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h6": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h24": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "marketCap": {
                            "type": "number"
                          },
                          "fdv": {
                            "type": "number"
                          },
                          "pairCreatedAt": {
                            "type": "number"
                          },
                          "dex": {
                            "type": "string"
                          },
                          "pairAddress": {
                            "type": "string"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "boosts": {
                            "type": "number"
                          },
                          "rank": {
                            "type": "number"
                          },
                          "rankChange1h": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "generatedAt": 1782000000000,
                  "maxAgeMs": 60000,
                  "source": "aggregate",
                  "count": 42,
                  "tokens": [
                    {
                      "mint": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
                      "symbol": "TRUMP",
                      "name": "OFFICIAL TRUMP",
                      "image": null,
                      "priceUsd": 12.34,
                      "priceChange": {
                        "m5": null,
                        "h1": -1.2,
                        "h6": 3.4,
                        "h24": -5.6
                      },
                      "volume": {
                        "m5": 1200,
                        "h1": 90000,
                        "h6": 510000,
                        "h24": 18450000
                      },
                      "txns": {
                        "m5": {
                          "buys": 3,
                          "sells": 1
                        },
                        "h1": {
                          "buys": 210,
                          "sells": 180
                        },
                        "h6": {
                          "buys": 900,
                          "sells": 820
                        },
                        "h24": {
                          "buys": 4200,
                          "sells": 3900
                        }
                      },
                      "liquidityUsd": 9200000,
                      "marketCap": 2400000000,
                      "fdv": 12000000000,
                      "pairCreatedAt": 1735680000000,
                      "dex": "raydium",
                      "pairAddress": "AbCd...",
                      "labels": [
                        "CLMM"
                      ],
                      "boosts": 500,
                      "rank": 1,
                      "rankChange1h": 2
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the DEX index error (success:false, error message"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/intel": {
      "get": {
        "summary": "Token intel (safety verdict + holders + risk)",
        "description": "Combines market details (holders, supply, top10/insider %), the DEX index, and Stryke-resolved top-10 owners with entity labels into a heuristic 0+ risk score and verdict. Cached 60s.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-intel",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if it fails the base58 regex."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level (spread from cached data object): mint, name, symbol, image, price_usd, market_cap, fdv, liquidity_usd, volume_24h, supply (decimals-adjusted UI supply, decimals-aware basis preferring on-chain getTokenSupply), holders, holders_meta{value,source('provider'|'enumeration'),exact,capped,as_of}, holders_nonvault (stricter clean/non-dust count), top10_pct, insider_pct (both clamped <=100), top_holders[], taxonomies{entityType,flags}, risk{score,verdict,risks[]}, pair, generatedAt(ms). holders is NEVER a bare null when we enumerated (capped:true = page-capped lower bound -> render 'N+'). top_holders entries: owner, amount, pct (clamped <=100), accounts, entity, entityType (cex/liquidity/program/wallet/...), entity_source (provider|registry|pda|program), is_contract (true for LP/pool/program/bridge vaults — suppress 'whale'), flags[] (v2 normalized enum dev/sniper/bundler/insider/pro_trader/fresh_wallet/smart_money/whale by default; flags_taxonomy=raw returns legacy strings). risk.score is additive heuristic (top10>70 +30 / >50 +15; insiders>10 +25; bundler>15% +20; sniper>10% +10; dev>5% +15); risk.verdict = high-risk(>=50)/risky(>=25)/caution(>=10)/safe. No data-vendor name in the body (entity_source uses provider|registry|pda|program). Also returned: metadata{logo=square token icon, header=wide social/cover banner image, description, websites[], socials[], createdAt, deployer, bonded}, market, distribution, pairs[], rugScore, verdict, flags[], deepscanAvailable, checkedAt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "image": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "market_cap": {
                      "type": "number"
                    },
                    "fdv": {
                      "type": "number"
                    },
                    "liquidity_usd": {
                      "type": "number"
                    },
                    "volume_24h": {
                      "type": "number"
                    },
                    "supply": {
                      "type": "number"
                    },
                    "holders": {
                      "type": "number"
                    },
                    "top10_pct": {
                      "type": "number"
                    },
                    "insider_pct": {
                      "type": "number"
                    },
                    "top_holders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "owner": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "pct": {
                            "type": "number"
                          },
                          "accounts": {
                            "type": "number"
                          },
                          "entity": {
                            "type": "string"
                          },
                          "entityType": {
                            "type": "string"
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "risk": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "verdict": {
                          "type": "string"
                        },
                        "risks": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "pair": {
                      "type": "object",
                      "properties": {
                        "chain": {
                          "type": "string"
                        },
                        "dex": {
                          "type": "string"
                        },
                        "address": {
                          "type": "string"
                        },
                        "quote": {
                          "type": "string"
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "name": "Bonk",
                  "symbol": "Bonk",
                  "image": "https://.../bonk.png",
                  "price_usd": 0.00002145,
                  "market_cap": 1600000000,
                  "fdv": 1900000000,
                  "liquidity_usd": 1800000,
                  "volume_24h": 4200000,
                  "supply": 88846160172790,
                  "holders": 712345,
                  "top10_pct": 18.4,
                  "insider_pct": 2.1,
                  "top_holders": [
                    {
                      "owner": "5Q5...wQ9",
                      "amount": 4200000000000,
                      "pct": 4.73,
                      "accounts": 2,
                      "entity": "Binance",
                      "entityType": "cex",
                      "flags": [
                        "cex"
                      ]
                    }
                  ],
                  "risk": {
                    "score": 0,
                    "verdict": "safe",
                    "risks": []
                  },
                  "pair": {
                    "chain": "solana",
                    "dex": "raydium",
                    "address": "AbCd...",
                    "quote": "SOL"
                  },
                  "generatedAt": 1718323200000
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream provider error (success:false, error message"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/ath": {
      "get": {
        "summary": "All-time high / low",
        "description": "All-time-high and all-time-low USD price for a token, with the current price's signed % distance from each. Reads the market-data layer's native athUSD/atlUSD/athDate fields; if the market-data layer lacks them, derives ATH/ATL from the full price-history series. Cached 120s.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-ath",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if it fails ^[1-9A-HJ-NP-Za-km-z]{32,44}$."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "price (current USD), ath / atl (all-time high/low USD), athDate / atlDate (ISO 8601 timestamps), fromAthPct / fromAtlPct (signed % distance of the current price from ATH/ATL — fromAthPct is ≤0, fromAtlPct ≥0), priceChange24h (24h % change). Values are all-time (full history), not windowed. When the native ATH/ATL is missing the fields are derived from the complete price series and the dates are emitted as ISO strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "price": {
                      "type": "number"
                    },
                    "ath": {
                      "type": "number"
                    },
                    "athDate": {
                      "type": "string"
                    },
                    "atl": {
                      "type": "number"
                    },
                    "atlDate": {
                      "type": "string"
                    },
                    "fromAthPct": {
                      "type": "number"
                    },
                    "fromAtlPct": {
                      "type": "number"
                    },
                    "priceChange24h": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "price": 0.000004349726555929913,
                  "ath": 0.00002823877551455234,
                  "athDate": "2025-08-14T03:48:46.000Z",
                  "atl": 1.195060923168786e-10,
                  "atlDate": "2025-11-12T19:34:22.700Z",
                  "fromAthPct": -84.59661767668233,
                  "fromAtlPct": 3639652.9796190765,
                  "priceChange24h": -2.948352950031966
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream market-data error"
          },
          "503": {
            "description": "market provider not configured"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/trades": {
      "get": {
        "summary": "Recent trades (live tape)",
        "description": "Recent swaps on a mint's primary pair from the market-data layer, normalised into a compact trade-tape shape. Cached 30s per (mint,limit).",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-trades",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20
            },
            "description": "Number of trades. Number(limit)||20, clamped to [1,100]."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level: mint, count (trades.length), trades[]. Each trade: hash (t.hash||t.transaction_hash), date, amountUSD (Number of token_amount_usd||amount_usd, 0 if absent), priceUSD (token_price||price_usd_token0||price_usd_token1), amount (token_amount), side (lowercased type/side e.g. 'buy'/'sell'), sender (sender||transaction_sender_address), platform. Returns 503 (success:false, 'trades provider not configured') when the market-data layer key is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "trades": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hash": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string"
                          },
                          "amountUSD": {
                            "type": "number"
                          },
                          "priceUSD": {
                            "type": "number"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "side": {
                            "type": "string"
                          },
                          "sender": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "count": 2,
                  "trades": [
                    {
                      "hash": "5xT...abc",
                      "date": "2026-06-13T22:14:05.000Z",
                      "amountUSD": 1240.55,
                      "priceUSD": 0.00002145,
                      "amount": 57835664.1,
                      "side": "buy",
                      "sender": "9aB...xy",
                      "platform": "raydium"
                    },
                    {
                      "hash": "7pQ...def",
                      "date": "2026-06-13T22:13:51.000Z",
                      "amountUSD": 310.2,
                      "priceUSD": 0.00002143,
                      "amount": 14475000,
                      "side": "sell",
                      "sender": "3Cd...zz",
                      "platform": "raydium"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the market-data layer error (success:false, error message"
          },
          "503": {
            "description": "trades provider not configured (the market-data layer key missing"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/deepscan": {
      "get": {
        "summary": "Deep Scan (token safety / rug verdict)",
        "description": "Runs the full Stryke Deep Scan engine: ~16 own on-chain layers (contract/holders/liquidity/bundle/creator/market/launch/holderstats/cohorts/lplock/honeypot/swapstats/devforensics/sniperforensics/programs/bubblemap) cross-validated by an external safety provider (always) plus an external safety provider/an external market provider/the holder-graph provider/an external market provider (when keyed), folded into one 0-100 higher=safer score, grade, verdict and flagged risks. Cached 120s.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-deepscan",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid. Canonicalized (trimmed) internally."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level (spread from deepScan result): mint (canonical), score (0-100, higher=safer), grade ('safe'>=85 | 'caution'>=60 | 'risky'>=35 | 'danger'<35; whitelist/stablecoin overrides exist), verdict (human string e.g. 'No issues found','Caution — has critical flags','Danger — likely rug / unsafe'), summary (string), layers (object keyed by layer name; each is a report {ok, checks[], errors[]} — failed/missing layers become {ok:false, checks:[], errors:[...], _stub:true}; each check is {id, ok, severity('critical'|'high'|'medium'|'warning'|'low'|'info'), label, detail}), providers (multiple external safety providers; each {ok, available, scoreSafe0to100, checks[], errors[]}; unkeyed providers are {ok:false, available:false, scoreSafe0to100:null, _notConfigured:true}), flags[] (every failing check across all layers+providers, sorted critical->info then by source), crossValidation {an external safety providerSafe, agree, note}, weights (scoring internals: startScore, severityPenalty, additiveScore, failingCounts, totalFailing, hardCapped, hardCapReasons, honeypotConfirmed, entityAdjusted, mature, whitelisted, regulatedStablecoin,...), entity (compact bubblemap summary {decentralizationScore, largestClusterPct, entityCount, clusteredPct, hiddenSupplyPct, entity_nakamoto, entity_gini, nodeCount, linkCount} or null), generatedAt(ms).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "score": {
                      "type": "number"
                    },
                    "grade": {
                      "type": "string"
                    },
                    "verdict": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "layers": {
                      "type": "object",
                      "properties": {
                        "contract": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "ok": {
                                    "type": "boolean"
                                  },
                                  "severity": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "holders": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "liquidity": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "bundle": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "creator": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "market": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "launch": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "holderstats": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "cohorts": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "lplock": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "honeypot": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "swapstats": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "devforensics": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "sniperforensics": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "programs": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "safeProgramOwners": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "bubblemap": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "checks": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        }
                      }
                    },
                    "providers": {
                      "type": "object",
                      "properties": {
                        "an external safety provider": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "available": {
                              "type": "boolean"
                            },
                            "scoreSafe0to100": {},
                            "checks": {
                              "type": "array",
                              "items": {}
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            },
                            "_notConfigured": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "crossValidation": {
                      "type": "object",
                      "properties": {
                        "an external safety providerSafe": {
                          "type": "number"
                        },
                        "agree": {
                          "type": "boolean"
                        },
                        "note": {}
                      }
                    },
                    "weights": {
                      "type": "object",
                      "properties": {
                        "startScore": {
                          "type": "number"
                        },
                        "additiveScore": {
                          "type": "number"
                        },
                        "totalFailing": {
                          "type": "number"
                        },
                        "hardCapped": {
                          "type": "boolean"
                        },
                        "hardCapReasons": {
                          "type": "array",
                          "items": {}
                        },
                        "mature": {
                          "type": "boolean"
                        },
                        "whitelisted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "decentralizationScore": {
                          "type": "number"
                        },
                        "largestClusterPct": {
                          "type": "number"
                        },
                        "entityCount": {
                          "type": "number"
                        },
                        "clusteredPct": {
                          "type": "number"
                        },
                        "hiddenSupplyPct": {
                          "type": "number"
                        },
                        "entity_nakamoto": {
                          "type": "number"
                        },
                        "entity_gini": {
                          "type": "number"
                        },
                        "nodeCount": {
                          "type": "number"
                        },
                        "linkCount": {
                          "type": "number"
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "score": 88,
                  "grade": "safe",
                  "verdict": "Looks safe — only minor flags",
                  "summary": "Mature blue-chip; diffuse holder distribution; LP burned.",
                  "layers": {
                    "contract": {
                      "ok": true,
                      "checks": [
                        {
                          "id": "mint_authority",
                          "ok": true,
                          "severity": "info",
                          "label": "Mint authority revoked",
                          "detail": "..."
                        }
                      ],
                      "errors": []
                    },
                    "holders": {
                      "ok": true,
                      "checks": [],
                      "errors": []
                    },
                    "liquidity": {
                      "ok": true,
                      "checks": [],
                      "errors": []
                    },
                    "bundle": {
                      "ok": true,
                      "checks": [],
                      "errors": []
                    },
                    "creator": {
                      "ok": true,
                      "checks": [],
                      "errors": []
                    },
                    "market": {
                      "ok": true,
                      "checks": [],
                      "errors": []
                    },
                    "launch": {
                      "ok": true,
                      "checks": []
                    },
                    "holderstats": {
                      "ok": true,
                      "checks": []
                    },
                    "cohorts": {
                      "ok": true,
                      "checks": []
                    },
                    "lplock": {
                      "ok": true,
                      "checks": []
                    },
                    "honeypot": {
                      "ok": true,
                      "checks": []
                    },
                    "swapstats": {
                      "ok": true,
                      "checks": []
                    },
                    "devforensics": {
                      "ok": true,
                      "checks": []
                    },
                    "sniperforensics": {
                      "ok": true,
                      "checks": []
                    },
                    "programs": {
                      "ok": true,
                      "checks": [],
                      "safeProgramOwners": []
                    },
                    "bubblemap": {
                      "ok": true,
                      "checks": []
                    }
                  },
                  "providers": {
                    "an external safety provider": {
                      "ok": false,
                      "available": false,
                      "scoreSafe0to100": null,
                      "checks": [],
                      "errors": [],
                      "_notConfigured": true
                    }
                  },
                  "flags": [
                    {
                      "id": "top10_concentration",
                      "source": "holders",
                      "ok": false,
                      "severity": "medium",
                      "label": "...",
                      "detail": "..."
                    }
                  ],
                  "crossValidation": {
                    "an external safety providerSafe": 90,
                    "agree": true,
                    "note": null
                  },
                  "weights": {
                    "startScore": 100,
                    "additiveScore": 0,
                    "totalFailing": 1,
                    "hardCapped": false,
                    "hardCapReasons": [],
                    "mature": true,
                    "whitelisted": false
                  },
                  "entity": {
                    "decentralizationScore": 82,
                    "largestClusterPct": 6.2,
                    "entityCount": 3,
                    "clusteredPct": 12.4,
                    "hiddenSupplyPct": 1.1,
                    "entity_nakamoto": 14,
                    "entity_gini": 0.61,
                    "nodeCount": 120,
                    "linkCount": 210
                  },
                  "generatedAt": 1718323200000
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "deepScan/upstream error (success:false, error message"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/bubblemap": {
      "get": {
        "summary": "Bubble Map entity graph",
        "description": "Returns the unified holder/funder entity graph (weighted union-find entity resolution) — nodes, links (typed + weighted with evidence), clusters, plus decentralization/concentration summary. Replaces the holder-graph provider + InsightX Atlas + an external safety provider insider graph. Cached 120s.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-bubblemap",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid. Canonicalized internally."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level (spread from analyzeBubblemap report): ok (bool), mint (canonical), nodes[], links[], clusters[], decentralizationScore (0-100 or null), largestClusterPct (number), summary{...}, checks[], errors[]. node: {id, kind, label, pctSupply, balance, rank, flags[], entity_id, degree, is_cex, is_dex, is_lp, is_supernode, fresh_wallet, first_buy_slot, age_sec} sorted by pctSupply desc then degree. link: {source, target, type (edge type e.g. same_funder/same_slot/transfer/peel), weight (number or null from EDGE_WEIGHTS), evidence (object — the WHY)}. cluster: {entity_id, kind, memberCount, pctSupply, rootFunder, collector, devLinked, confidence, kinds[], evidence[], members[]}. summary carries both raw and entity-collapsed concentration metrics (gini/hhi/nakamoto + entity_gini/entity_hhi/entity_nakamoto), clusteredPct, hiddenSupplyPct, decimals (client scales raw balances), holdersTotal (distinct owners found -> 'top N of M'). On invalid/unbuildable graph the report returns ok:false with empty nodes/links/clusters and an info check. analyzeBubblemap never throws.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "nodes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "pctSupply": {
                            "type": "number"
                          },
                          "balance": {
                            "type": "number"
                          },
                          "rank": {
                            "type": "number"
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "entity_id": {
                            "type": "string"
                          },
                          "degree": {
                            "type": "number"
                          },
                          "is_cex": {
                            "type": "boolean"
                          },
                          "is_dex": {
                            "type": "boolean"
                          },
                          "is_lp": {
                            "type": "boolean"
                          },
                          "is_supernode": {
                            "type": "boolean"
                          },
                          "fresh_wallet": {
                            "type": "boolean"
                          },
                          "first_buy_slot": {},
                          "age_sec": {}
                        }
                      }
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string"
                          },
                          "target": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "weight": {
                            "type": "number"
                          },
                          "evidence": {
                            "type": "object",
                            "properties": {
                              "funder": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "clusters": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity_id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "memberCount": {
                            "type": "number"
                          },
                          "pctSupply": {
                            "type": "number"
                          },
                          "rootFunder": {
                            "type": "string"
                          },
                          "collector": {},
                          "devLinked": {
                            "type": "boolean"
                          },
                          "confidence": {
                            "type": "number"
                          },
                          "kinds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "evidence": {
                            "type": "array",
                            "items": {}
                          },
                          "members": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "decentralizationScore": {
                      "type": "number"
                    },
                    "largestClusterPct": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "entityCount": {
                          "type": "number"
                        },
                        "nodeCount": {
                          "type": "number"
                        },
                        "linkCount": {
                          "type": "number"
                        },
                        "clusteredPct": {
                          "type": "number"
                        },
                        "hiddenSupplyPct": {
                          "type": "number"
                        },
                        "gini": {
                          "type": "number"
                        },
                        "hhi": {
                          "type": "number"
                        },
                        "nakamoto": {
                          "type": "number"
                        },
                        "entity_gini": {
                          "type": "number"
                        },
                        "entity_hhi": {
                          "type": "number"
                        },
                        "entity_nakamoto": {
                          "type": "number"
                        },
                        "decimals": {
                          "type": "number"
                        },
                        "holdersTotal": {
                          "type": "number"
                        }
                      }
                    },
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "ok": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "nodes": [
                    {
                      "id": "5Q5...wQ9",
                      "kind": "holder",
                      "label": "Binance",
                      "pctSupply": 4.7312,
                      "balance": 4200000000000,
                      "rank": 1,
                      "flags": [
                        "cex"
                      ],
                      "entity_id": "5Q5...wQ9",
                      "degree": 3,
                      "is_cex": true,
                      "is_dex": false,
                      "is_lp": false,
                      "is_supernode": false,
                      "fresh_wallet": false,
                      "first_buy_slot": null,
                      "age_sec": null
                    }
                  ],
                  "links": [
                    {
                      "source": "AaA...1",
                      "target": "BbB...2",
                      "type": "same_funder",
                      "weight": 0.8,
                      "evidence": {
                        "funder": "Cc...3"
                      }
                    }
                  ],
                  "clusters": [
                    {
                      "entity_id": "ent_1",
                      "kind": "bundle",
                      "memberCount": 4,
                      "pctSupply": 8.21,
                      "rootFunder": "Cc...3",
                      "collector": null,
                      "devLinked": false,
                      "confidence": 0.74,
                      "kinds": [
                        "same_funder"
                      ],
                      "evidence": [],
                      "members": [
                        "AaA...1",
                        "BbB...2"
                      ]
                    }
                  ],
                  "decentralizationScore": 82,
                  "largestClusterPct": 8.21,
                  "summary": {
                    "entityCount": 3,
                    "nodeCount": 120,
                    "linkCount": 210,
                    "clusteredPct": 12.4,
                    "hiddenSupplyPct": 1.1,
                    "gini": 0.71,
                    "hhi": 0.04,
                    "nakamoto": 12,
                    "entity_gini": 0.61,
                    "entity_hhi": 0.05,
                    "entity_nakamoto": 11,
                    "decimals": 5,
                    "holdersTotal": 250
                  },
                  "checks": [
                    {
                      "id": "entity_concentration",
                      "ok": true,
                      "severity": "info",
                      "label": "Diffuse entity distribution",
                      "detail": "3 entities; largest 8.2% of float."
                    }
                  ],
                  "errors": []
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "wrapper error (success:false, error message"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/safety": {
      "get": {
        "summary": "Safety chip (canonical, list-cheap)",
        "description": "Compact per-token safety summary (0-100 HIGHER=SAFER) cheap enough to fan out across a whole list (Radar/Oracle/cards). Derives from a warm deepscan (status complete) else a cheap intel chip (status partial); never runs a fresh full deepscan. Cached 60s. A batch form GET /api/v2/tokens/safety?mints=a,b,c (<=30) returns {success,results:{<mint>:chip}}.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-safety",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL mint (base58). 400 'invalid mint' if invalid."
          },
          {
            "name": "flags",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 3
            },
            "description": "Max topGreen and topRed each (clamped 1-5)."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Bust ONLY the 60s safety memo (never triggers a full deepscan)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "score 0-100 HIGHER=SAFER (== deepscan.score when warm). grade from gradeFor() (>=85 safe / >=60 caution / >=35 risky / else danger). topGreen/topRed entries {id,label,detail,severity(critical|high|medium|low|info)} are OWN-LAYER checks ONLY — vendor-named provider echoes are excluded, so NO data-vendor name appears in the body. venues deduped by dexId, primary=highest-h24-vol. source: deepscan (warm full scan, status complete) | intel (cheap chip, partial) | venues (status pending). NEVER 5xx — a failing mint degrades to status pending.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "score": {
                      "type": "number"
                    },
                    "grade": {
                      "type": "string"
                    },
                    "verdict": {
                      "type": "string"
                    },
                    "topGreen": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "topRed": {
                      "type": "array",
                      "items": {}
                    },
                    "hardCapped": {
                      "type": "boolean"
                    },
                    "hardCapReason": {},
                    "venues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dex": {
                            "type": "string"
                          },
                          "dexId": {
                            "type": "string"
                          },
                          "iconKey": {
                            "type": "string"
                          },
                          "pairAddress": {
                            "type": "string"
                          },
                          "primary": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "primaryVenue": {
                      "type": "string"
                    },
                    "liquidityUsd": {
                      "type": "number"
                    },
                    "scannedAt": {
                      "type": "number"
                    },
                    "source": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "score": 90,
                  "grade": "safe",
                  "verdict": "Verified blue-chip — safe",
                  "topGreen": [
                    {
                      "id": "mint_authority",
                      "label": "Mint authority renounced",
                      "detail": "Supply cannot be inflated",
                      "severity": "info"
                    }
                  ],
                  "topRed": [],
                  "hardCapped": false,
                  "hardCapReason": null,
                  "venues": [
                    {
                      "dex": "meteora",
                      "dexId": "meteora",
                      "iconKey": "meteora",
                      "pairAddress": "7ee...T2",
                      "primary": true
                    }
                  ],
                  "primaryVenue": "meteora",
                  "liquidityUsd": 1715749,
                  "scannedAt": 1782000000000,
                  "source": "deepscan",
                  "status": "complete"
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/tokens/search": {
      "get": {
        "summary": "Token search (superset)",
        "description": "Autocomplete token search by name/symbol/address. SUPERSET of the old search entry — each result now carries full card data: image/header/description, decimals, socials_list, websites_list, multi-window priceChange/volume/txns, buy/sell counts, marketCap/fdv/liquidityUsd, pairAddress/dexId, boosts, age, base/quote tokens and DEX labels. Replaces any prior /tokens/search entry.",
        "tags": [
          "Tokens"
        ],
        "operationId": "tokens-search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search query (name, symbol, or mint). Minimum 2 chars; shorter returns an empty results array."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "results[] — up to 20 mints, deduped by mint keeping the highest-h24-volume pair. Base fields (mint, symbol, name, image, url, priceUsd, priceChange, volume24h, liquidityUsd, marketCap, fdv, pair{}, socials{}, websites[]) come from the the DEX index shaper; the superset fields (header, description, decimals, socials_list, websites_list, volume{m5,h1,h6,h24}, txns{...}{buys,sells}, buys24h, sells24h, pairCreatedAt, ageHours, boosts, dexId, pairAddress, baseToken, quoteToken, labels) are layered on top. USD/price fields are glitch-clamped (price ≤ 1e7, USD ≤ 1e12). decimals is backfilled from the local indexer then a single batched the metadata service call. Cached 60s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "priceChange": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "number"
                              },
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "volume24h": {
                            "type": "number"
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "marketCap": {
                            "type": "number"
                          },
                          "fdv": {
                            "type": "number"
                          },
                          "pair": {
                            "type": "object",
                            "properties": {
                              "chain": {
                                "type": "string"
                              },
                              "dex": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "quote": {
                                "type": "string"
                              }
                            }
                          },
                          "socials": {
                            "type": "object",
                            "properties": {
                              "twitter": {
                                "type": "string"
                              }
                            }
                          },
                          "websites": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "header": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "socials_list": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "websites_list": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "volume": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "number"
                              },
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "txns": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h1": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h6": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h24": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          },
                          "buys24h": {
                            "type": "number"
                          },
                          "sells24h": {
                            "type": "number"
                          },
                          "pairCreatedAt": {
                            "type": "number"
                          },
                          "ageHours": {
                            "type": "number"
                          },
                          "boosts": {
                            "type": "number"
                          },
                          "dexId": {
                            "type": "string"
                          },
                          "pairAddress": {
                            "type": "string"
                          },
                          "baseToken": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              }
                            }
                          },
                          "quoteToken": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              }
                            }
                          },
                          "labels": {
                            "type": "array",
                            "items": {}
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "results": [
                    {
                      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                      "symbol": "BONK",
                      "name": "Bonk",
                      "image": "https://dd.dexscreener.com/ds-data/tokens/solana/Dez...png",
                      "url": "https://dexscreener.com/solana/8...",
                      "priceUsd": 0.00002413,
                      "priceChange": {
                        "m5": 0.1,
                        "h1": -0.4,
                        "h6": 1.2,
                        "h24": 5.6
                      },
                      "volume24h": 18650000,
                      "liquidityUsd": 7420000,
                      "marketCap": 1820000000,
                      "fdv": 1820000000,
                      "pair": {
                        "chain": "solana",
                        "dex": "raydium",
                        "address": "8...",
                        "quote": "SOL"
                      },
                      "socials": {
                        "twitter": "https://x.com/bonk_inu"
                      },
                      "websites": [
                        "https://bonkcoin.com"
                      ],
                      "header": "https://dd.dexscreener.com/.../header.png",
                      "description": "The community dog coin of Solana.",
                      "decimals": 5,
                      "socials_list": [
                        {
                          "type": "twitter",
                          "url": "https://x.com/bonk_inu"
                        }
                      ],
                      "websites_list": [
                        {
                          "url": "https://bonkcoin.com"
                        }
                      ],
                      "volume": {
                        "m5": 12000,
                        "h1": 410000,
                        "h6": 3100000,
                        "h24": 18650000
                      },
                      "txns": {
                        "m5": {
                          "buys": 40,
                          "sells": 31
                        },
                        "h1": {
                          "buys": 900,
                          "sells": 820
                        },
                        "h6": {
                          "buys": 5400,
                          "sells": 5100
                        },
                        "h24": {
                          "buys": 21000,
                          "sells": 19500
                        }
                      },
                      "buys24h": 21000,
                      "sells24h": 19500,
                      "pairCreatedAt": 1672531200000,
                      "ageHours": 12480.5,
                      "boosts": 0,
                      "dexId": "raydium",
                      "pairAddress": "8...",
                      "baseToken": {
                        "address": "Dez...",
                        "name": "Bonk",
                        "symbol": "BONK"
                      },
                      "quoteToken": {
                        "symbol": "SOL",
                        "address": "So111...112"
                      },
                      "labels": []
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "the DEX index (or DAS backfill) upstream failed"
          }
        }
      }
    },
    "/api/v2/tokens/trending/raw": {
      "get": {
        "summary": "Trending tokens (raw, tagged)",
        "description": "Merged, deduped and enriched trending feed built from the DEX index boosts/top + boosts/latest + profiles/latest, resolved to full pairs. Each token carries source tags, dex_rank, raw (un-neutralized) image, rich price/volume/txn windows and boost amount — so a consumer can build gainers/losers/new/trending/promoted lists itself.",
        "tags": [
          "Tokens"
        ],
        "operationId": "tokens-trending-raw",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "tokens[] — same superset shape as /tokens/search results PLUS: image (raw the DEX index/boost icon, NOT neutralized), boosts (max boost amount seen), dex_rank (rank in the boosts/top list, null if only seen in latest/profiles feeds), tags[] (subset of 'boosted','recent_boost','new'), source ('aggregate'). Up to 90 seed mints resolved; tokens without a resolvable pair are dropped. Sorted by boosts desc then h24 volume desc. generatedAt is epoch ms; maxAgeMs is the 60s cache window. USD/price glitch-clamped.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "generatedAt": {
                      "type": "number"
                    },
                    "maxAgeMs": {
                      "type": "number"
                    },
                    "count": {
                      "type": "number"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "priceChange": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "number"
                              },
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "volume24h": {
                            "type": "number"
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "marketCap": {
                            "type": "number"
                          },
                          "fdv": {
                            "type": "number"
                          },
                          "pair": {
                            "type": "object",
                            "properties": {
                              "chain": {
                                "type": "string"
                              },
                              "dex": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "quote": {
                                "type": "string"
                              }
                            }
                          },
                          "socials": {
                            "type": "object",
                            "properties": {
                              "telegram": {
                                "type": "string"
                              }
                            }
                          },
                          "websites": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "header": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "socials_list": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "websites_list": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "volume": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "number"
                              },
                              "h1": {
                                "type": "number"
                              },
                              "h6": {
                                "type": "number"
                              },
                              "h24": {
                                "type": "number"
                              }
                            }
                          },
                          "txns": {
                            "type": "object",
                            "properties": {
                              "m5": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h1": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h6": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              },
                              "h24": {
                                "type": "object",
                                "properties": {
                                  "buys": {
                                    "type": "number"
                                  },
                                  "sells": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          },
                          "buys24h": {
                            "type": "number"
                          },
                          "sells24h": {
                            "type": "number"
                          },
                          "pairCreatedAt": {
                            "type": "number"
                          },
                          "ageHours": {
                            "type": "number"
                          },
                          "boosts": {
                            "type": "number"
                          },
                          "dexId": {
                            "type": "string"
                          },
                          "pairAddress": {
                            "type": "string"
                          },
                          "baseToken": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              }
                            }
                          },
                          "quoteToken": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              }
                            }
                          },
                          "labels": {
                            "type": "array",
                            "items": {}
                          },
                          "dex_rank": {
                            "type": "number"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "source": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "generatedAt": 1719446400000,
                  "maxAgeMs": 60000,
                  "count": 2,
                  "tokens": [
                    {
                      "mint": "7xKp...moon",
                      "symbol": "MOON",
                      "name": "Moon",
                      "image": "https://dd.dexscreener.com/.../moon.png",
                      "url": "https://dexscreener.com/solana/AbCd",
                      "priceUsd": 0.0123,
                      "priceChange": {
                        "m5": 2.1,
                        "h1": 8.4,
                        "h6": 40.2,
                        "h24": 120.5
                      },
                      "volume24h": 540000,
                      "liquidityUsd": 210000,
                      "marketCap": 1230000,
                      "fdv": 1230000,
                      "pair": {
                        "chain": "solana",
                        "dex": "raydium",
                        "address": "AbCd",
                        "quote": "SOL"
                      },
                      "socials": {
                        "telegram": "https://t.me/moon"
                      },
                      "websites": [
                        "https://moon.fun"
                      ],
                      "header": "https://dd.dexscreener.com/.../header.png",
                      "description": "To the moon.",
                      "decimals": 6,
                      "socials_list": [
                        {
                          "type": "telegram",
                          "url": "https://t.me/moon"
                        }
                      ],
                      "websites_list": [
                        {
                          "url": "https://moon.fun"
                        }
                      ],
                      "volume": {
                        "m5": 8000,
                        "h1": 90000,
                        "h6": 320000,
                        "h24": 540000
                      },
                      "txns": {
                        "m5": {
                          "buys": 60,
                          "sells": 20
                        },
                        "h1": {
                          "buys": 700,
                          "sells": 300
                        },
                        "h6": {
                          "buys": 2400,
                          "sells": 1100
                        },
                        "h24": {
                          "buys": 4800,
                          "sells": 2600
                        }
                      },
                      "buys24h": 4800,
                      "sells24h": 2600,
                      "pairCreatedAt": 1719360000000,
                      "ageHours": 24,
                      "boosts": 500,
                      "dexId": "raydium",
                      "pairAddress": "AbCd",
                      "baseToken": {
                        "address": "7xKp...moon",
                        "name": "Moon",
                        "symbol": "MOON"
                      },
                      "quoteToken": {
                        "symbol": "SOL",
                        "address": "So111...112"
                      },
                      "labels": [],
                      "dex_rank": 1,
                      "tags": [
                        "boosted",
                        "new"
                      ],
                      "source": "aggregate"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Trending feed unavailable (the DEX index boosts/profiles upstream failed) — body is {success:false,error:\"trending unavailable\"}"
          }
        }
      }
    },
    "/api/v2/tokens/pairs-batch": {
      "post": {
        "summary": "Pairs batch (full the DEX index)",
        "description": "Returns the full, glitch-sanitized primary the DEX index pair object for up to 50 mints in one call — every price/volume/txn window plus liquidity, marketCap/fdv and info{imageUrl,header,description,socials,websites}. For consumers that build their own cards. Per-mint 30s cache.",
        "tags": [
          "Tokens"
        ],
        "operationId": "tokens-pairs-batch",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "pairs is a map keyed by mint → full pair object (or null if no pair found for that mint). count is the number of non-null pairs. When multiple pairs exist for a mint the highest-h24-volume one wins. All USD/price fields glitch-clamped (price ≤ 1e7, USD ≤ 1e12). labels capped to 8. Each mint cached 30s independently, so overlapping batches share hits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "pairs": {
                      "type": "object",
                      "properties": {
                        "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                          "type": "object",
                          "properties": {
                            "chainId": {
                              "type": "string"
                            },
                            "dexId": {
                              "type": "string"
                            },
                            "pairAddress": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "baseToken": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                }
                              }
                            },
                            "quoteToken": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                }
                              }
                            },
                            "priceUsd": {
                              "type": "number"
                            },
                            "priceNative": {
                              "type": "number"
                            },
                            "priceChange": {
                              "type": "object",
                              "properties": {
                                "m5": {
                                  "type": "number"
                                },
                                "h1": {
                                  "type": "number"
                                },
                                "h6": {
                                  "type": "number"
                                },
                                "h24": {
                                  "type": "number"
                                }
                              }
                            },
                            "volume": {
                              "type": "object",
                              "properties": {
                                "m5": {
                                  "type": "number"
                                },
                                "h1": {
                                  "type": "number"
                                },
                                "h6": {
                                  "type": "number"
                                },
                                "h24": {
                                  "type": "number"
                                }
                              }
                            },
                            "txns": {
                              "type": "object",
                              "properties": {
                                "m5": {
                                  "type": "object",
                                  "properties": {
                                    "buys": {
                                      "type": "number"
                                    },
                                    "sells": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "h1": {
                                  "type": "object",
                                  "properties": {
                                    "buys": {
                                      "type": "number"
                                    },
                                    "sells": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "h6": {
                                  "type": "object",
                                  "properties": {
                                    "buys": {
                                      "type": "number"
                                    },
                                    "sells": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "h24": {
                                  "type": "object",
                                  "properties": {
                                    "buys": {
                                      "type": "number"
                                    },
                                    "sells": {
                                      "type": "number"
                                    }
                                  }
                                }
                              }
                            },
                            "liquidity": {
                              "type": "object",
                              "properties": {
                                "usd": {
                                  "type": "number"
                                },
                                "base": {
                                  "type": "number"
                                },
                                "quote": {
                                  "type": "number"
                                }
                              }
                            },
                            "marketCap": {
                              "type": "number"
                            },
                            "fdv": {
                              "type": "number"
                            },
                            "pairCreatedAt": {
                              "type": "number"
                            },
                            "labels": {
                              "type": "array",
                              "items": {}
                            },
                            "boosts": {
                              "type": "object",
                              "properties": {
                                "active": {
                                  "type": "number"
                                }
                              }
                            },
                            "info": {
                              "type": "object",
                              "properties": {
                                "imageUrl": {
                                  "type": "string"
                                },
                                "header": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "socials": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "websites": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "pairs": {
                    "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                      "chainId": "solana",
                      "dexId": "raydium",
                      "pairAddress": "8B...",
                      "url": "https://dexscreener.com/solana/8B",
                      "baseToken": {
                        "address": "Dez...",
                        "name": "Bonk",
                        "symbol": "BONK"
                      },
                      "quoteToken": {
                        "address": "So111...112",
                        "name": "Wrapped SOL",
                        "symbol": "SOL"
                      },
                      "priceUsd": 0.00002413,
                      "priceNative": 1.6e-7,
                      "priceChange": {
                        "m5": 0.1,
                        "h1": -0.4,
                        "h6": 1.2,
                        "h24": 5.6
                      },
                      "volume": {
                        "m5": 12000,
                        "h1": 410000,
                        "h6": 3100000,
                        "h24": 18650000
                      },
                      "txns": {
                        "m5": {
                          "buys": 40,
                          "sells": 31
                        },
                        "h1": {
                          "buys": 900,
                          "sells": 820
                        },
                        "h6": {
                          "buys": 5400,
                          "sells": 5100
                        },
                        "h24": {
                          "buys": 21000,
                          "sells": 19500
                        }
                      },
                      "liquidity": {
                        "usd": 7420000,
                        "base": 150000000000,
                        "quote": 24000
                      },
                      "marketCap": 1820000000,
                      "fdv": 1820000000,
                      "pairCreatedAt": 1672531200000,
                      "labels": [],
                      "boosts": {
                        "active": 0
                      },
                      "info": {
                        "imageUrl": "https://dd.dexscreener.com/.../bonk.png",
                        "header": "https://dd.dexscreener.com/.../header.png",
                        "description": "The community dog coin of Solana.",
                        "socials": [
                          {
                            "type": "twitter",
                            "url": "https://x.com/bonk_inu"
                          }
                        ],
                        "websites": [
                          {
                            "url": "https://bonkcoin.com"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "mints[] missing/empty or contains no valid mints — error \"mints[] required (max 50 valid mints)\""
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "the DEX index batch upstream failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of SPL mint addresses. Invalid entries are dropped; capped at the first 50 valid mints."
                  }
                },
                "required": [
                  "mints"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/metadata-full": {
      "get": {
        "summary": "Token metadata (enriched)",
        "description": "Off-chain enriched metadata for a Solana token: categories/tags, VC investors, supply allocation %, global rank, and a richer socials block. Curated off-chain (the market-data layer Metacore) — best for established tokens; sparse for fresh mints.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-metadata-full",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana token mint (base58). Validated; invalid returns 400."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "rank": {
                      "type": "number"
                    },
                    "decimals": {
                      "type": "number"
                    },
                    "priceUSD": {
                      "type": "number"
                    },
                    "marketCapUSD": {
                      "type": "number"
                    },
                    "liquidityUSD": {
                      "type": "number"
                    },
                    "volume24hUSD": {
                      "type": "number"
                    },
                    "totalSupply": {
                      "type": "number"
                    },
                    "circulatingSupply": {
                      "type": "number"
                    },
                    "maxSupply": {
                      "type": "number"
                    },
                    "description": {
                      "type": "string"
                    },
                    "logo": {
                      "type": "string"
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "investors": {
                      "type": "array",
                      "items": {}
                    },
                    "distribution": {
                      "type": "array",
                      "items": {}
                    },
                    "socials": {
                      "type": "object",
                      "properties": {
                        "twitter": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "discord": {},
                        "telegram": {
                          "type": "string"
                        }
                      }
                    },
                    "otherChains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezX...B263",
                  "name": "Bonk",
                  "symbol": "BONK",
                  "rank": 127,
                  "decimals": 5,
                  "priceUSD": 0.00000403,
                  "marketCapUSD": 354686610.69,
                  "liquidityUSD": 68408.71,
                  "volume24hUSD": 338600.57,
                  "totalSupply": 89187752916383,
                  "circulatingSupply": 87987140074620,
                  "maxSupply": 93526183276778,
                  "description": "",
                  "logo": "https://...",
                  "categories": [
                    "Meme"
                  ],
                  "investors": [],
                  "distribution": [],
                  "socials": {
                    "twitter": "https://twitter.com/bonk_inu",
                    "website": "https://www.bonkcoin.com",
                    "discord": null,
                    "telegram": "https://t.me/Official_Bonk_Inu"
                  },
                  "otherChains": [
                    "Ethereum",
                    "Polygon",
                    "Arbitrum"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/tokens/screener": {
      "get": {
        "summary": "Token screener / search",
        "description": "Search Solana tokens sortable by trendingScore24h, volume24h, liquidity, holdersCount, createdAt, or organicVolume1h (bot-filtered volume). A screener view over the token universe.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-screener",
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search term (symbol / name fragment)."
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "volume24h"
            },
            "description": "Sort field: trendingScore24h, volume24h, liquidity, holdersCount, createdAt, organicVolume1h."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "Results to return. Max 20."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "input": {
                      "type": "string"
                    },
                    "sortBy": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "priceUSD": {
                            "type": "number"
                          },
                          "marketCapUSD": {
                            "type": "number"
                          },
                          "liquidityUSD": {
                            "type": "number"
                          },
                          "volume24hUSD": {
                            "type": "number"
                          },
                          "holders": {
                            "type": "number"
                          },
                          "logo": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "input": "bonk",
                  "sortBy": "organicVolume1h",
                  "count": 1,
                  "results": [
                    {
                      "mint": "BonkUg9t...hwWY",
                      "symbol": "Bonk",
                      "name": "Bonk",
                      "decimals": 6,
                      "priceUSD": 0.00000656,
                      "marketCapUSD": 3279723.35,
                      "liquidityUSD": 50.13,
                      "volume24hUSD": 127909.6,
                      "holders": 85,
                      "logo": "https://..."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/dev-history": {
      "get": {
        "summary": "Dev / deployer history",
        "description": "The creator/deployer wallet behind a mint plus its track record: prior launches, rug-rate, serial-/fast-rugger verdicts, dev-sold class, and funding-origin forensics (terminal funder / CEX, privacy-peel hops, operator ring). Thin wrapper over the dev-forensics engine that is also folded into /deepscan; self-resolves the deployer, so it is standalone-safe. Route memoized 2 min.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-dev-history",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL mint (base58). 400 \"invalid mint\" if invalid."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "dev is the resolved deployer; devSource is how it was resolved (e.g. \"bonding_curve\"). priorTokens/ruggedPriorTokens/rugRate summarize the deployer's earlier launches; serialRugger + fastRugger + medianTimeToRugSecs are behavioural verdicts (null when there is no prior history). devSoldPct/devSoldClass describe how much of THIS token the dev has offloaded. Funding origin: devFunderTerminal {address,name,category} is the terminal source (category e.g. \"cex\"); devFunderPeeled/privacyHops/devFunderPeel flag peel-chain obfuscation; operatorRing/operatorRingDetected/ringCoLaunchBurst flag a coordinated multi-wallet launch ring. checks[] are own-layer signals {id, ok (true=good), severity(critical|high|medium|low|info), label, detail}. errors[] lists any sub-analysis that degraded. ok:true means the report assembled (individual fields may still be null on a thin on-chain history).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "dev": {
                      "type": "string"
                    },
                    "devSource": {
                      "type": "string"
                    },
                    "priorTokens": {
                      "type": "number"
                    },
                    "ruggedPriorTokens": {
                      "type": "number"
                    },
                    "rugRate": {
                      "type": "number"
                    },
                    "peakPriorValueUsd": {},
                    "serialRugger": {
                      "type": "boolean"
                    },
                    "medianTimeToRugSecs": {},
                    "medianTimeToRugSamples": {},
                    "fastRugger": {
                      "type": "boolean"
                    },
                    "devSoldPct": {},
                    "devSoldClass": {},
                    "devRootFunder": {},
                    "devFunderTerminal": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        }
                      }
                    },
                    "devFunderPeeled": {
                      "type": "boolean"
                    },
                    "devFunderPeel": {},
                    "privacyHops": {
                      "type": "number"
                    },
                    "operatorRing": {},
                    "operatorRingDetected": {
                      "type": "boolean"
                    },
                    "ringCoLaunchBurst": {},
                    "devFunderPeelWeak": {},
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                  "ok": true,
                  "dev": "B4sAAVYE9v5iadYXdNYUdD1LoqtJi7xELJiGvfLwkmJD",
                  "devSource": "bonding_curve",
                  "priorTokens": 0,
                  "ruggedPriorTokens": 0,
                  "rugRate": 0,
                  "peakPriorValueUsd": null,
                  "serialRugger": false,
                  "medianTimeToRugSecs": null,
                  "medianTimeToRugSamples": null,
                  "fastRugger": false,
                  "devSoldPct": null,
                  "devSoldClass": null,
                  "devRootFunder": null,
                  "devFunderTerminal": {
                    "address": "BmFdpraQhkiDQE6SnfG5omcA1VwzqfXrwtNYBwWTymy6",
                    "name": "KuCoin",
                    "category": "cex"
                  },
                  "devFunderPeeled": false,
                  "devFunderPeel": null,
                  "privacyHops": 0,
                  "operatorRing": null,
                  "operatorRingDetected": false,
                  "ringCoLaunchBurst": null,
                  "devFunderPeelWeak": null,
                  "checks": [
                    {
                      "id": "dev_first_launch",
                      "ok": false,
                      "severity": "low",
                      "label": "First launch from deployer",
                      "detail": "No prior launch history — no track record yet."
                    },
                    {
                      "id": "dev_funder_cex",
                      "ok": true,
                      "severity": "info",
                      "label": "Deployer funded from a CEX",
                      "detail": "Deployer funded from KuCoin — organic on-chain origin."
                    }
                  ],
                  "errors": []
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "{ success:false, error } — upstream/on-chain analysis failure"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/snipers": {
      "get": {
        "summary": "Launch sniper cohort",
        "description": "The launch-sniper cohort for a mint: how many wallets sniped the launch, what share of supply they took, slot-0 vs cohort counts, their exit distribution (still holding / sold partial / sold full / bought more), bundle concentration, and a sampled per-sniper farming profile (serial-sniper / heavy-farmer flags). Combines the launch-tape analysis with sniper forensics (which reads the same tape). Route memoized 2 min.",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-mint-snipers",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL mint (base58). 400 \"invalid mint\" if invalid."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "launchSlot/launchTime anchor the launch. sniperCount/sniperPct = wallets that bought in the sniper window and the % of supply they took; slot0SniperCount/slot0SniperPct = the subset that landed in the launch slot; cohortSniperCount = the cohort size scored by forensics. sniperExit {classified, holding, soldPartial, soldFull, boughtMore} partitions the cohort by current disposition. bundledPct/bundleWalletCount measure how much of the cohort landed in bundled (same-block/coordinated) transactions. sampledSnipers[] is a SAMPLE (not the full cohort): {address, fungibles (# of other fungible tokens the wallet holds — a farming signal), serial (repeat sniper), heavy (heavy farmer)}. serialSniperRatio is the sampled share flagged as serial snipers. Forensics runs after the launch pass (it consumes the tape the launch pass populates); if forensics degrades, sampledSnipers is [] and serialSniperRatio is null while the launch aggregates still return.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "launchSlot": {
                      "type": "number"
                    },
                    "launchTime": {
                      "type": "number"
                    },
                    "sniperCount": {
                      "type": "number"
                    },
                    "sniperPct": {
                      "type": "number"
                    },
                    "slot0SniperCount": {
                      "type": "number"
                    },
                    "slot0SniperPct": {
                      "type": "number"
                    },
                    "cohortSniperCount": {
                      "type": "number"
                    },
                    "sniperExit": {
                      "type": "object",
                      "properties": {
                        "classified": {
                          "type": "number"
                        },
                        "holding": {
                          "type": "number"
                        },
                        "soldPartial": {
                          "type": "number"
                        },
                        "soldFull": {
                          "type": "number"
                        },
                        "boughtMore": {
                          "type": "number"
                        }
                      }
                    },
                    "bundledPct": {
                      "type": "number"
                    },
                    "bundleWalletCount": {
                      "type": "number"
                    },
                    "sampledSnipers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "fungibles": {
                            "type": "number"
                          },
                          "serial": {
                            "type": "boolean"
                          },
                          "heavy": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "serialSniperRatio": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                  "launchSlot": 431725260,
                  "launchTime": 1783569359,
                  "sniperCount": 70,
                  "sniperPct": 11.72,
                  "slot0SniperCount": 7,
                  "slot0SniperPct": 10.6,
                  "cohortSniperCount": 70,
                  "sniperExit": {
                    "classified": 70,
                    "holding": 2,
                    "soldPartial": 1,
                    "soldFull": 67,
                    "boughtMore": 0
                  },
                  "bundledPct": 99.33,
                  "bundleWalletCount": 70,
                  "sampledSnipers": [
                    {
                      "address": "F7RV6aBWfniixoFkQNWmRwznDj2vae2XbusFfvMMjtbE",
                      "fungibles": 49,
                      "serial": false,
                      "heavy": true
                    },
                    {
                      "address": "HsBK95XGUpVD3ENufWapD3Jib6zodHE6xj3VLArNBX3v",
                      "fungibles": 28,
                      "serial": false,
                      "heavy": false
                    }
                  ],
                  "serialSniperRatio": 0
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "{ success:false, error } — launch/forensics analysis failure"
          }
        }
      }
    },
    "/api/v2/tokens/safety": {
      "get": {
        "summary": "Safety chips (batch)",
        "description": "Batch form of the per-token safety chip (0-100 HIGHER=SAFER): fan a comma-separated mint list (max 30) into one call and get a map of chips keyed by mint. Each chip derives from a warm deepscan (status complete) else a cheap intel chip (status partial); it NEVER runs a fresh full deepscan. Per-mint degrade — a failing mint returns a pending/error chip instead of failing the batch. Sibling of GET /api/v2/tokens/{mint}/safety (single).",
        "tags": [
          "Tokens"
        ],
        "operationId": "get-api-v2-tokens-safety-batch",
        "parameters": [
          {
            "name": "mints",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated SPL mints (base58). Invalid mints are dropped; the list is capped to the first 30 valid mints. 400 \"mints required …\" if none are valid."
          },
          {
            "name": "flags",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 3
            },
            "description": "Max topGreen and topRed each per chip (clamped 1-5)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "results is a map<mint, chip>. Each chip matches the single-mint /safety body minus the top-level success: {mint, score (0-100 HIGHER=SAFER), grade (safe|caution|risky|danger), verdict, topGreen/topRed ({id,label,detail,severity(critical|high|medium|low|info)} — OWN-LAYER checks only, no vendor names), venues (deduped by dexId, primary=highest 24h vol), liquidityUsd, source (deepscan|intel|venues|error), status (complete|partial|pending)}. topGreen/topRed are each sliced to `flags`. A mint that throws degrades to {status:\"pending\", score:null, grade:null, …, source:\"error\"} — never a 5xx.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "results": {
                      "type": "object",
                      "properties": {
                        "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "score": {
                              "type": "number"
                            },
                            "grade": {
                              "type": "string"
                            },
                            "verdict": {
                              "type": "string"
                            },
                            "topGreen": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "severity": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "topRed": {
                              "type": "array",
                              "items": {}
                            },
                            "venues": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "dex": {
                                    "type": "string"
                                  },
                                  "dexId": {
                                    "type": "string"
                                  },
                                  "iconKey": {
                                    "type": "string"
                                  },
                                  "pairAddress": {
                                    "type": "string"
                                  },
                                  "primary": {
                                    "type": "boolean"
                                  }
                                }
                              }
                            },
                            "liquidityUsd": {
                              "type": "number"
                            },
                            "source": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        },
                        "So11111111111111111111111111111111111111112": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "score": {},
                            "grade": {},
                            "topGreen": {
                              "type": "array",
                              "items": {}
                            },
                            "topRed": {
                              "type": "array",
                              "items": {}
                            },
                            "venues": {
                              "type": "array",
                              "items": {}
                            },
                            "source": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "results": {
                    "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": {
                      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                      "score": 90,
                      "grade": "safe",
                      "verdict": "Verified blue-chip — safe",
                      "topGreen": [
                        {
                          "id": "mint_authority",
                          "label": "Mint authority renounced",
                          "detail": "Supply cannot be inflated",
                          "severity": "info"
                        }
                      ],
                      "topRed": [],
                      "venues": [
                        {
                          "dex": "meteora",
                          "dexId": "meteora",
                          "iconKey": "meteora",
                          "pairAddress": "7ee…T2",
                          "primary": true
                        }
                      ],
                      "liquidityUsd": 1715749,
                      "source": "deepscan",
                      "status": "complete"
                    },
                    "So11111111111111111111111111111111111111112": {
                      "mint": "So11111111111111111111111111111111111111112",
                      "status": "pending",
                      "score": null,
                      "grade": null,
                      "topGreen": [],
                      "topRed": [],
                      "venues": [],
                      "source": "error"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "mints required (comma-separated, max 30 valid SPL mints"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/portfolio": {
      "get": {
        "summary": "Wallet portfolio (token holdings)",
        "description": "Returns the wallet's live token holdings with USD values, prices, 24h change and allocation. Primary source is the market-data layer's portfolio endpoint; falls back to the metadata service getAssetsByOwner (including native SOL) when the market-data layer isn't configured.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-portfolio",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58, 32-44 chars). Validated by SOL_ADDR_RE; invalid returns 400."
          },
          {
            "name": "fresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Pass fresh=true to bypass the 30s server-side cache and force a live provider fetch. Any other value (or absent) serves from cache (cache.memo key 'port:<wallet>', 30000ms TTL)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, wallet, then the spread of the shaped portfolio object: totalValueUSD (number), tokenCount (number), tokens (array). Each token has mint, symbol, name, image, balance, usdValue, price, priceChange24h, allocation. On the Stryke's node layer fallback path, priceChange24h and allocation are 0 and totalValueUSD is summed from per-token usdValue. SOL is injected as the first token on the fallback path when nativeBalance.lamports > 0.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "totalValueUSD": {
                      "type": "number"
                    },
                    "tokenCount": {
                      "type": "number"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "image": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "balance": {
                            "type": "number"
                          },
                          "usdValue": {
                            "type": "number"
                          },
                          "price": {
                            "type": "number"
                          },
                          "priceChange24h": {
                            "type": "number"
                          },
                          "allocation": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "totalValueUSD": 12834.55,
                  "tokenCount": 7,
                  "tokens": [
                    {
                      "mint": "So11111111111111111111111111111111111111112",
                      "symbol": "SOL",
                      "name": "Solana",
                      "image": "https://.../logo.png",
                      "balance": 42.137,
                      "usdValue": 6320.55,
                      "price": 150,
                      "priceChange24h": -2.3,
                      "allocation": 49.2
                    },
                    {
                      "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                      "symbol": "USDC",
                      "name": "USD Coin",
                      "image": null,
                      "balance": 3100,
                      "usdValue": 3100,
                      "price": 1,
                      "priceChange24h": 0,
                      "allocation": 24.1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet (fails base58 regex"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream provider error (err.message — e.g. 'no portfolio provider configured', the market-data layer/Stryke's node layer failure"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/nfts": {
      "get": {
        "summary": "Wallet NFTs",
        "description": "Non-fungible holdings for a wallet — standard, compressed, and MPL-Core assets — resolved via the metadata/asset index. Fungible token balances are filtered out (use /portfolio for those). Paginated. Cached 60s.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-nfts",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Owner wallet address (base58). 400 'invalid wallet address' if invalid."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "DAS page number (1-based)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Assets per page. Clamped to 1–100."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "nfts[] each: { mint, name, symbol, image (resolved metadata image / CDN URI), collection (the collection grouping address, or null if ungrouped), compressed (true for compressed NFTs), interface (asset standard — V1_NFT, ProgrammableNFT, MplCoreAsset, etc.) }. count is the NFTs on this page after filtering out fungibles; total is the provider's total asset count for the page query (fungibles included). Airdrop / spam NFTs are not filtered — they are real on-chain holdings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "page": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "count": {
                      "type": "number"
                    },
                    "total": {
                      "type": "number"
                    },
                    "nfts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "collection": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "compressed": {
                            "type": "boolean"
                          },
                          "interface": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "GDfnEsia2WLAW5t8yx2X5j2mkfA74i5kwGdDuZHt7XmG",
                  "page": 1,
                  "limit": 4,
                  "count": 4,
                  "total": 4,
                  "nfts": [
                    {
                      "mint": "HJR4SEEQBjGDZavq44WqgL7X7YUsDTZiW154ptgjAkTe",
                      "name": "Magic #727",
                      "symbol": "DWNO",
                      "image": "https://bafybeigbcal7fql27dbjaseih533b6tvprmhasacr65z4xahjwsv2baozi.ipfs.nftstorage.link/0.gif",
                      "collection": null,
                      "compressed": true,
                      "interface": "V1_NFT"
                    },
                    {
                      "mint": "H471xMeNTxFmBh6PoDNkUuL3VmKctXqj67w414CYcShS",
                      "name": "Third round Drop",
                      "symbol": "3TRD",
                      "image": "https://img.hi-hi.vip/json/img/555jup.png",
                      "collection": "7MgADPWSAgd7HjkzLZGjby3EbhZZQUzdptXzTsotEV7",
                      "compressed": true,
                      "interface": "V1_NFT"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream asset-index error"
          },
          "503": {
            "description": "asset provider not configured"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/history": {
      "get": {
        "summary": "Portfolio balance history",
        "description": "Returns a time series of the wallet's total balance (USD value) over time from the market-data layer's wallet/history endpoint, normalized to {t,v} points.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-history",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "30d"
            },
            "description": "One of 1h, 1d, 7d, 30d, 90d, 365d. Any other value falls back to 30d."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Start timestamp; passed through to the market-data layer as 'from'. Parsed via Number()."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "End timestamp; passed through to the market-data layer as 'to'. Parsed via Number()."
          },
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict the history to a single asset/token; passed through to the market-data layer as 'asset'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, wallet, period, from, to, series. series is an array of {t, v} points mapped from the market-data layer data.balance_history (supports both [timestamp,value] tuple and {timestamp/t, value/v} object forms); points with falsy t or non-finite v are filtered out. Cached 60s via cache.memo key 'hist:<wallet>:<period>:<from>:<to>:<asset>'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "from": {},
                    "to": {},
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "t": {
                            "type": "number"
                          },
                          "v": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "period": "30d",
                  "from": null,
                  "to": null,
                  "series": [
                    {
                      "t": 1717200000000,
                      "v": 11250.42
                    },
                    {
                      "t": 1717286400000,
                      "v": 11980.1
                    },
                    {
                      "t": 1717372800000,
                      "v": 12834.55
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the market-data layer error"
          },
          "503": {
            "description": "history provider not configured (the market-data layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/trades": {
      "get": {
        "summary": "Wallet trades (swap history)",
        "description": "Returns the wallet's the market-data layer-derived swap/trade history, passed through largely verbatim from the market-data layer's wallet/trades endpoint.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-trades",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100
            },
            "description": "Number of trades. Clamped to 1..500 via Math.max(1, Math.min(500, Number(limit) || 100))."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Start timestamp; passed to the market-data layer as 'from'."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "End timestamp; passed to the market-data layer as 'to'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, wallet, count, trades. count is trades.length. trades is the market-data layer's data.trades array passed through unchanged (field names are the market-data layer's own, not re-shaped by this handler). Cached 60s via cache.memo key 'trades:<wallet>:<limit>:<from>:<to>'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "trades": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "token_amount": {
                            "type": "number"
                          },
                          "token_amount_usd": {
                            "type": "number"
                          },
                          "hash": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "count": 2,
                  "trades": [
                    {
                      "date": 1717200000,
                      "type": "buy",
                      "token_amount": 1500000,
                      "token_amount_usd": 420.5,
                      "hash": "5x...sig"
                    },
                    {
                      "date": 1717286400,
                      "type": "sell",
                      "token_amount": 1500000,
                      "token_amount_usd": 510.2,
                      "hash": "9z...sig"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the market-data layer error (known to occasionally 503 upstream"
          },
          "503": {
            "description": "trades provider not configured (the market-data layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/activity": {
      "get": {
        "summary": "Wallet activity feed",
        "description": "Returns recent on-chain wallet events (swaps, transfers, liquidations, etc.) from the market-data layer's v2 wallet/activity endpoint with spam filtering and unlisted assets enabled.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-activity",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Number of activity items. Clamped to 1..200 via Math.max(1, Math.min(200, Number(limit) || 50))."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "desc"
            },
            "description": "Sort order. 'asc' or 'desc' — anything other than 'asc' becomes 'desc'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, wallet, count, activity. count is the length of the market-data layer's data array. activity is the market-data layer's data array passed through unchanged (the market-data layer field names). the market-data layer call sets filterSpam=true and unlistedAssets=true. Cached 30s via cache.memo key 'act:<wallet>:<limit>:<order>'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "activity": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hash": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "asset": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              }
                            }
                          },
                          "amount": {
                            "type": "number"
                          },
                          "amount_usd": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "count": 2,
                  "activity": [
                    {
                      "hash": "5x...sig",
                      "timestamp": 1717286400,
                      "type": "swap",
                      "asset": {
                        "symbol": "BONK"
                      },
                      "amount": 1500000,
                      "amount_usd": 510.2
                    },
                    {
                      "hash": "3a...sig",
                      "timestamp": 1717200000,
                      "type": "transfer",
                      "amount_usd": 12
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the market-data layer error"
          },
          "503": {
            "description": "activity provider not configured (the market-data layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/transactions": {
      "get": {
        "summary": "Decoded transactions (Stryke's node layer enhanced)",
        "description": "Returns parsed, human-readable transactions for the wallet via Stryke's node layer's Enhanced Transactions REST API — each with a type, source, description, tokenTransfers and nativeTransfers. Supports keyset pagination and type/source filters.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-transactions",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Number of transactions. Clamped to 1..100 via Math.max(1, Math.min(100, Number(limit) || 50))."
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Paginate: return txs before this signature. Only applied if it matches the signature regex /^[a-zA-Z0-9]{43,128}$/."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Paginate: return txs until this signature. Only applied if it passes signature validation."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by Stryke's node layer transaction type (e.g. SWAP, TRANSFER, NFT_SALE). Truncated to 40 chars and passed to Stryke's node layer."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by Stryke's node layer source (e.g. JUPITER, RAYDIUM, MAGIC_EDEN). Truncated to 40 chars and passed to Stryke's node layer."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, wallet, count, transactions. transactions is the raw Stryke's node layer Enhanced Transactions array (this handler does NOT re-shape it). Each item carries the Stryke's node layer schema: signature, timestamp, type, source, fee, feePayer, slot, description, tokenTransfers[], nativeTransfers[], instructions[], events, transactionError. count is transactions.length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signature": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "fee": {
                            "type": "number"
                          },
                          "feePayer": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "tokenTransfers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "fromUserAccount": {
                                  "type": "string"
                                },
                                "toUserAccount": {
                                  "type": "string"
                                },
                                "mint": {
                                  "type": "string"
                                },
                                "tokenAmount": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "nativeTransfers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "fromUserAccount": {
                                  "type": "string"
                                },
                                "toUserAccount": {
                                  "type": "string"
                                },
                                "amount": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "instructions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "programId": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "transactionError": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "count": 1,
                  "transactions": [
                    {
                      "signature": "5x...sig",
                      "timestamp": 1717286400,
                      "type": "SWAP",
                      "source": "JUPITER",
                      "fee": 15000,
                      "feePayer": "6Yg9...M3kP",
                      "description": "Swapped 1.5 SOL for 1500000 BONK",
                      "tokenTransfers": [
                        {
                          "fromUserAccount": "...",
                          "toUserAccount": "6Yg9...M3kP",
                          "mint": "DezX...BONK",
                          "tokenAmount": 1500000
                        }
                      ],
                      "nativeTransfers": [
                        {
                          "fromUserAccount": "6Yg9...M3kP",
                          "toUserAccount": "...",
                          "amount": 1500000000
                        }
                      ],
                      "instructions": [
                        {
                          "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"
                        }
                      ],
                      "transactionError": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream Stryke's node layer enhanced-tx error (non-200 status"
          },
          "503": {
            "description": "transactions provider not configured (Stryke's node layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/funding": {
      "get": {
        "summary": "Funding source (genesis)",
        "description": "Traces a wallet's first-ever transaction to surface who funded it and with how much SOL. Uses an archival genesis-forward (oldest-first) lookup when available, else falls back to the oldest signature in the recent window. Genesis is immutable, so the result is cached 1h.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-funding",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address to trace (base58). 400 'invalid wallet address' if invalid."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "funded (bool). When funded:true → funder (the account that sent the most SOL in the genesis transaction), amountSol (SOL the wallet received in that tx; falls back to the funder's net debit), signature (the genesis transaction), blockTime (unix seconds), slot. funded:false (no other fields) when the wallet has no discoverable transaction history. funder is a heuristic — the non-wallet account with the largest balance decrease — so for genesis txs with multiple senders it returns the dominant source.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "funded": {
                      "type": "boolean"
                    },
                    "funder": {
                      "type": "string"
                    },
                    "amountSol": {
                      "type": "number"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "blockTime": {
                      "type": "number"
                    },
                    "slot": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "GDfnEsia2WLAW5t8yx2X5j2mkfA74i5kwGdDuZHt7XmG",
                  "funded": true,
                  "funder": "crwnQamrVin5xNjhCmiv93U8GDgwpxB9GQbqmx8UWFQ",
                  "amountSol": 0.0014616,
                  "signature": "3cUGwFapDzXukYGirzvouFutqRh2FVxMKvQQQRswDuPprsxE2No6xnTgB1y2GkkTaN1jfdG2Zus4HcDtHVQaNqoV",
                  "blockTime": 1674570378,
                  "slot": 174160573
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream RPC error"
          },
          "503": {
            "description": "transaction provider not configured"
          }
        }
      }
    },
    "/api/v2/wallets/decode-tx": {
      "post": {
        "summary": "Bulk decode transactions",
        "description": "Bulk-decodes arbitrary transaction signatures into Stryke's node layer's parsed/enhanced format. Send a signatures array; up to 100 valid signatures are decoded via Stryke's node layer's /v0/transactions parser.",
        "tags": [
          "Wallets"
        ],
        "operationId": "post-api-v2-wallets-decode-tx",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success, count, transactions (no wallet key — this is a signature-keyed bulk decode). transactions is the raw Stryke's node layer parseTransactions array (same enhanced schema as the /transactions endpoint). count is transactions.length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signature": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "fee": {
                            "type": "number"
                          },
                          "feePayer": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "tokenTransfers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "mint": {
                                  "type": "string"
                                },
                                "tokenAmount": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "nativeTransfers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "transactionError": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "transactions": [
                    {
                      "signature": "5x...sig",
                      "timestamp": 1717286400,
                      "type": "SWAP",
                      "source": "JUPITER",
                      "fee": 15000,
                      "feePayer": "6Yg9...M3kP",
                      "description": "Swapped 1.5 SOL for 1500000 BONK",
                      "tokenTransfers": [
                        {
                          "mint": "DezX...BONK",
                          "tokenAmount": 1500000
                        }
                      ],
                      "nativeTransfers": [
                        {
                          "amount": 1500000000
                        }
                      ],
                      "transactionError": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "signatures[] required (max 100 valid sigs) — body missing/empty or no valid signatures"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream Stryke's node layer parse-transactions error"
          },
          "503": {
            "description": "decode provider not configured (Stryke's node layer key missing"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signatures": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of base58 transaction signatures. Filtered by the signature regex /^[a-zA-Z0-9]{43,128}$/ and capped at the first 100 valid entries. If zero valid signatures remain, returns 400 'signatures[] required (max 100 valid sigs)'."
                  }
                },
                "required": [
                  "signatures"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/profile": {
      "get": {
        "summary": "Deep wallet profile",
        "description": "The heavy aggregation endpoint. Walks up to 5 Stryke's node layer enhanced-tx pages plus 1 the market-data layer portfolio and computes a structured WalletProfile: identity/classification, biography, activity rhythm, per-token cohorts with rough realised PnL, behavioral fingerprint (sniper/paperhand/diamond/gambler/night-owl/discipline), velocity, sizing, risk, DEX breakdown, counterparty graph, holdings, trader tags and dozens of derived sections.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-profile",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "deep"
            },
            "description": "'fast' walks 2 Stryke's node layer pages (~200 txs); anything else (default) is 'deep' = 5 pages (~500 txs)."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Filter txs to timestamp >= since. Snapped to the nearest day (floor(since/86400)*86400) so cache keys converge. Used by /wrapped to scope to a one-year window. Non-finite or <=0 is ignored (null)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response is {success:true,...assemble(...)}. the assembler returns ~50 top-level keys: wallet, depth, scanned (txs analyzed after the since-filter), solPriceUsd, identity {kind,label}, biography (string), activity (with topPrograms now carrying a resolved name field), risk, fingerprint, velocity, sizing (sizingRich with largestBuySymbol/avgBuyUsd/maxBuyUsd/sizePnlCorr/sizePnlSample), failures, pnl, concentration, mevAwareness, oldestPosition, biggestLesson, bestTrade, dexBreakdown, dexPnl, compounding, selfShuffler, recoveryRate, overview, hourlyPerformance, hourlyDowMatrix, holdDistribution, holdSummary, dustAttackIndex {count,total,pct}, stakingOpportunity {idleSol,stakeableSol,yearlySol,yearlyUsd,apyPct} (null when idle <= 0.05 reserve), closeableAccounts {total,empty,nonempty,recoverableSol,recoverableUsd} (null if Stryke's node layer unavailable), monthlyPnl, sharpe, lossAversion, streaks, failureBreakdown, tokenGraveyard, panicSells, hodlBenchmark, biggestDays, traderTags (array of {key,label,tone}, capped 8), cohorts {total,stillHolding,bought,top[]} (top is up to 30 enriched per-token cohorts), trades {wins[],losses[]}, counterparties (top 10, labeled with label/kind), holdings (the market-data layer portfolio: totalUsd, tokenCount, dustBags, topBags[], worst24h) or null. The example trims long arrays for brevity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "string"
                    },
                    "scanned": {
                      "type": "number"
                    },
                    "solPriceUsd": {
                      "type": "number"
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      }
                    },
                    "biography": {
                      "type": "string"
                    },
                    "activity": {
                      "type": "object",
                      "properties": {
                        "ageDays": {
                          "type": "number"
                        },
                        "oldestTs": {
                          "type": "number"
                        },
                        "newestTs": {
                          "type": "number"
                        },
                        "hourBins": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "dowBins": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "hourDowMatrix": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "longestStreakDays": {
                          "type": "number"
                        },
                        "busiestDay": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "count": {
                              "type": "number"
                            }
                          }
                        },
                        "nftActivity": {
                          "type": "number"
                        },
                        "selfTransfers": {
                          "type": "number"
                        },
                        "topPrograms": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "risk": {
                      "type": "object",
                      "properties": {
                        "totalTx": {
                          "type": "number"
                        },
                        "failedCount": {
                          "type": "number"
                        },
                        "failureRate": {
                          "type": "number"
                        },
                        "avgGasPerSwapLamports": {
                          "type": "number"
                        },
                        "totalFeesLamports": {
                          "type": "number"
                        },
                        "totalJitoTipsLamports": {
                          "type": "number"
                        },
                        "jitoTipCount": {
                          "type": "number"
                        },
                        "biggestLossLamports": {
                          "type": "number"
                        },
                        "biggestLossSig": {
                          "type": "string"
                        },
                        "biggestWinLamports": {
                          "type": "number"
                        },
                        "biggestWinSig": {
                          "type": "string"
                        }
                      }
                    },
                    "fingerprint": {
                      "type": "object",
                      "properties": {
                        "sniper": {
                          "type": "number"
                        },
                        "paperhand": {
                          "type": "number"
                        },
                        "diamond": {
                          "type": "number"
                        },
                        "gambler": {
                          "type": "number"
                        },
                        "nightOwl": {
                          "type": "number"
                        },
                        "discipline": {
                          "type": "number"
                        },
                        "drift": {
                          "type": "object",
                          "properties": {
                            "gambler": {
                              "type": "number"
                            },
                            "nightOwl": {
                              "type": "number"
                            },
                            "sample": {
                              "type": "number"
                            }
                          }
                        },
                        "avgHoldHours": {
                          "type": "number"
                        },
                        "cohortCount": {
                          "type": "number"
                        },
                        "boughtCount": {
                          "type": "number"
                        },
                        "flipSample": {
                          "type": "number"
                        }
                      }
                    },
                    "velocity": {
                      "type": "object",
                      "properties": {
                        "txPerDay": {
                          "type": "number"
                        },
                        "tokensPerDay": {
                          "type": "number"
                        },
                        "intervals": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "avgSec": {
                              "type": "number"
                            },
                            "medianSec": {
                              "type": "number"
                            },
                            "cv": {
                              "type": "number"
                            },
                            "histogram": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "isBotlike": {
                          "type": "boolean"
                        },
                        "peakTps": {
                          "type": "number"
                        },
                        "burstMinutes": {
                          "type": "number"
                        },
                        "activeMinutes": {
                          "type": "number"
                        },
                        "burstPct": {
                          "type": "number"
                        },
                        "momentumLabel": {
                          "type": "string"
                        },
                        "momentumRatio": {
                          "type": "number"
                        }
                      }
                    },
                    "sizing": {
                      "type": "object",
                      "properties": {
                        "buyCount": {
                          "type": "number"
                        },
                        "avgBuySol": {
                          "type": "number"
                        },
                        "medianBuySol": {
                          "type": "number"
                        },
                        "maxBuySol": {
                          "type": "number"
                        },
                        "p90BuySol": {
                          "type": "number"
                        },
                        "largestBuyMint": {
                          "type": "string"
                        },
                        "largestBuySymbol": {
                          "type": "string"
                        },
                        "avgBuyUsd": {
                          "type": "number"
                        },
                        "sizePnlCorr": {
                          "type": "number"
                        },
                        "sizePnlSample": {
                          "type": "number"
                        },
                        "histogram": {
                          "type": "array",
                          "items": {}
                        },
                        "disciplineScore": {
                          "type": "number"
                        },
                        "disciplineCv": {
                          "type": "number"
                        }
                      }
                    },
                    "failures": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "byProgram": {
                          "type": "array",
                          "items": {}
                        },
                        "byHour": {
                          "type": "array",
                          "items": {}
                        },
                        "topErrors": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "pnl": {
                      "type": "object",
                      "properties": {
                        "realisedSol": {
                          "type": "number"
                        },
                        "realisedUsd": {
                          "type": "number"
                        },
                        "unrealisedUsd": {
                          "type": "number"
                        },
                        "netUsd": {
                          "type": "number"
                        },
                        "wins": {
                          "type": "number"
                        },
                        "losses": {
                          "type": "number"
                        },
                        "breakeven": {
                          "type": "number"
                        },
                        "closed": {
                          "type": "number"
                        },
                        "profitFactor": {
                          "type": "number"
                        }
                      }
                    },
                    "concentration": {
                      "type": "object",
                      "properties": {}
                    },
                    "mevAwareness": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "tippedSwaps": {
                          "type": "number"
                        },
                        "swapCount": {
                          "type": "number"
                        }
                      }
                    },
                    "oldestPosition": {
                      "type": "object",
                      "properties": {
                        "mint": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        }
                      }
                    },
                    "biggestLesson": {
                      "type": "object",
                      "properties": {
                        "mint": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        }
                      }
                    },
                    "bestTrade": {
                      "type": "object",
                      "properties": {
                        "mint": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        }
                      }
                    },
                    "dexBreakdown": {
                      "type": "object",
                      "properties": {
                        "breakdown": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "category": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              },
                              "pct": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "dexPnl": {
                      "type": "object",
                      "properties": {}
                    },
                    "compounding": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "sample": {
                          "type": "number"
                        }
                      }
                    },
                    "selfShuffler": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "selfTransfers": {
                          "type": "number"
                        },
                        "totalSends": {
                          "type": "number"
                        },
                        "topDestinations": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "recoveryRate": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "sample": {
                          "type": "number"
                        },
                        "recoveredMints": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "overview": {
                      "type": "object",
                      "properties": {
                        "swapCount": {
                          "type": "number"
                        },
                        "txCount": {
                          "type": "number"
                        },
                        "swapVolumeSol": {
                          "type": "number"
                        },
                        "swapVolumeUsd": {
                          "type": "number"
                        },
                        "feesSol": {
                          "type": "number"
                        },
                        "prioritySol": {
                          "type": "number"
                        },
                        "jitoSol": {
                          "type": "number"
                        },
                        "activeDays": {
                          "type": "number"
                        },
                        "longestStreakDays": {
                          "type": "number"
                        },
                        "currentStreakDays": {
                          "type": "number"
                        },
                        "firstSwapTs": {
                          "type": "number"
                        },
                        "lastSwapTs": {
                          "type": "number"
                        },
                        "monthlyFees": {
                          "type": "array",
                          "items": {}
                        },
                        "monthlyVolume": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "hourlyPerformance": {
                      "type": "array",
                      "items": {}
                    },
                    "hourlyDowMatrix": {
                      "type": "array",
                      "items": {}
                    },
                    "holdDistribution": {
                      "type": "array",
                      "items": {}
                    },
                    "holdSummary": {
                      "type": "object",
                      "properties": {}
                    },
                    "dustAttackIndex": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        },
                        "total": {
                          "type": "number"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    },
                    "stakingOpportunity": {
                      "type": "object",
                      "properties": {
                        "idleSol": {
                          "type": "number"
                        },
                        "stakeableSol": {
                          "type": "number"
                        },
                        "yearlySol": {
                          "type": "number"
                        },
                        "yearlyUsd": {
                          "type": "number"
                        },
                        "apyPct": {
                          "type": "number"
                        }
                      }
                    },
                    "closeableAccounts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "empty": {
                          "type": "number"
                        },
                        "nonempty": {
                          "type": "number"
                        },
                        "recoverableSol": {
                          "type": "number"
                        },
                        "recoverableUsd": {
                          "type": "number"
                        }
                      }
                    },
                    "monthlyPnl": {
                      "type": "array",
                      "items": {}
                    },
                    "sharpe": {
                      "type": "object",
                      "properties": {}
                    },
                    "lossAversion": {
                      "type": "object",
                      "properties": {}
                    },
                    "streaks": {
                      "type": "object",
                      "properties": {
                        "longest": {
                          "type": "number"
                        },
                        "currentlyActive": {
                          "type": "number"
                        },
                        "longestHourRun": {
                          "type": "number"
                        }
                      }
                    },
                    "failureBreakdown": {
                      "type": "object",
                      "properties": {}
                    },
                    "tokenGraveyard": {
                      "type": "object",
                      "properties": {}
                    },
                    "panicSells": {
                      "type": "object",
                      "properties": {}
                    },
                    "hodlBenchmark": {
                      "type": "object",
                      "properties": {}
                    },
                    "biggestDays": {
                      "type": "array",
                      "items": {}
                    },
                    "traderTags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "tone": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "cohorts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "stillHolding": {
                          "type": "number"
                        },
                        "bought": {
                          "type": "number"
                        },
                        "top": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "image": {
                                "type": "string"
                              },
                              "priceUsd": {
                                "type": "number"
                              },
                              "buys": {
                                "type": "number"
                              },
                              "sells": {
                                "type": "number"
                              },
                              "receives": {
                                "type": "number"
                              },
                              "sends": {
                                "type": "number"
                              },
                              "wasBought": {
                                "type": "boolean"
                              },
                              "realisedSol": {
                                "type": "number"
                              },
                              "realisedUsd": {
                                "type": "number"
                              },
                              "stillHolds": {
                                "type": "boolean"
                              },
                              "firstBuyTs": {
                                "type": "number"
                              },
                              "lastActivityTs": {
                                "type": "number"
                              },
                              "avgHoldHours": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "trades": {
                      "type": "object",
                      "properties": {
                        "wins": {
                          "type": "array",
                          "items": {}
                        },
                        "losses": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "counterparties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addr": {
                            "type": "string"
                          },
                          "inLamports": {
                            "type": "number"
                          },
                          "outLamports": {
                            "type": "number"
                          },
                          "count": {
                            "type": "number"
                          },
                          "swapTouches": {
                            "type": "number"
                          },
                          "totalLamports": {
                            "type": "number"
                          },
                          "netLamports": {
                            "type": "number"
                          },
                          "flavor": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "holdings": {
                      "type": "object",
                      "properties": {
                        "totalUsd": {
                          "type": "number"
                        },
                        "tokenCount": {
                          "type": "number"
                        },
                        "dustBags": {
                          "type": "number"
                        },
                        "topBags": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "mint": {
                                "type": "string"
                              },
                              "balance": {
                                "type": "number"
                              },
                              "usd": {
                                "type": "number"
                              },
                              "price": {
                                "type": "number"
                              },
                              "change24h": {
                                "type": "number"
                              },
                              "allocation": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "worst24h": {
                          "type": "object",
                          "properties": {
                            "symbol": {
                              "type": "string"
                            },
                            "change24h": {
                              "type": "number"
                            },
                            "delta": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "depth": "deep",
                  "scanned": 487,
                  "solPriceUsd": 150.2,
                  "identity": {
                    "kind": "active_trader",
                    "label": "Active trader"
                  },
                  "biography": "...",
                  "activity": {
                    "ageDays": 214,
                    "oldestTs": 1698800000,
                    "newestTs": 1717286400,
                    "hourBins": [
                      3,
                      1,
                      0
                    ],
                    "dowBins": [
                      12,
                      40,
                      33,
                      29,
                      31,
                      25,
                      18
                    ],
                    "hourDowMatrix": [
                      0
                    ],
                    "longestStreakDays": 9,
                    "busiestDay": {
                      "date": "2026-03-14",
                      "count": 41
                    },
                    "nftActivity": 2,
                    "selfTransfers": 4,
                    "topPrograms": [
                      {
                        "id": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
                        "count": 120,
                        "name": "Jupiter v6"
                      }
                    ]
                  },
                  "risk": {
                    "totalTx": 487,
                    "failedCount": 18,
                    "failureRate": 3.7,
                    "avgGasPerSwapLamports": 42000,
                    "totalFeesLamports": 3100000,
                    "totalJitoTipsLamports": 800000,
                    "jitoTipCount": 12,
                    "biggestLossLamports": 2400000000,
                    "biggestLossSig": "5x...",
                    "biggestWinLamports": 1900000000,
                    "biggestWinSig": "9z..."
                  },
                  "fingerprint": {
                    "sniper": 34,
                    "paperhand": 61,
                    "diamond": 22,
                    "gambler": 48,
                    "nightOwl": 18,
                    "discipline": 96,
                    "drift": {
                      "gambler": -5,
                      "nightOwl": 3,
                      "sample": 120
                    },
                    "avgHoldHours": 7.4,
                    "cohortCount": 63,
                    "boughtCount": 41,
                    "flipSample": 22
                  },
                  "velocity": {
                    "txPerDay": 2.3,
                    "tokensPerDay": 0.9,
                    "intervals": {
                      "count": 486,
                      "avgSec": 37000,
                      "medianSec": 900,
                      "cv": 2.4,
                      "histogram": []
                    },
                    "isBotlike": false,
                    "peakTps": 6,
                    "burstMinutes": 14,
                    "activeMinutes": 300,
                    "burstPct": 4.7,
                    "momentumLabel": "steady",
                    "momentumRatio": 1
                  },
                  "sizing": {
                    "buyCount": 40,
                    "avgBuySol": 0.85,
                    "medianBuySol": 0.5,
                    "maxBuySol": 12,
                    "p90BuySol": 3.1,
                    "largestBuyMint": "DezX...",
                    "largestBuySymbol": "BONK",
                    "avgBuyUsd": 128,
                    "sizePnlCorr": 0.12,
                    "sizePnlSample": 18,
                    "histogram": [],
                    "disciplineScore": 71,
                    "disciplineCv": 0.96
                  },
                  "failures": {
                    "total": 18,
                    "byProgram": [],
                    "byHour": [],
                    "topErrors": []
                  },
                  "pnl": {
                    "realisedSol": 4.2,
                    "realisedUsd": 631,
                    "unrealisedUsd": -220,
                    "netUsd": 411,
                    "wins": 11,
                    "losses": 7,
                    "breakeven": 3,
                    "closed": 21,
                    "profitFactor": 1.6
                  },
                  "concentration": {},
                  "mevAwareness": {
                    "score": 18,
                    "tippedSwaps": 12,
                    "swapCount": 214
                  },
                  "oldestPosition": {
                    "mint": "...",
                    "symbol": "WIF"
                  },
                  "biggestLesson": {
                    "mint": "...",
                    "symbol": "..."
                  },
                  "bestTrade": {
                    "mint": "...",
                    "symbol": "..."
                  },
                  "dexBreakdown": {
                    "breakdown": [
                      {
                        "category": "jupiter",
                        "count": 120,
                        "pct": 56
                      }
                    ]
                  },
                  "dexPnl": {},
                  "compounding": {
                    "score": 40,
                    "sample": 12
                  },
                  "selfShuffler": {
                    "score": 2,
                    "selfTransfers": 4,
                    "totalSends": 190,
                    "topDestinations": []
                  },
                  "recoveryRate": {
                    "score": 33,
                    "sample": 6,
                    "recoveredMints": []
                  },
                  "overview": {
                    "swapCount": 214,
                    "txCount": 487,
                    "swapVolumeSol": 182.4,
                    "swapVolumeUsd": 27396,
                    "feesSol": 0.0031,
                    "prioritySol": 0.0006,
                    "jitoSol": 0.0008,
                    "activeDays": 140,
                    "longestStreakDays": 9,
                    "currentStreakDays": 0,
                    "firstSwapTs": 1698800000,
                    "lastSwapTs": 1717286400,
                    "monthlyFees": [],
                    "monthlyVolume": []
                  },
                  "hourlyPerformance": [],
                  "hourlyDowMatrix": [],
                  "holdDistribution": [],
                  "holdSummary": {},
                  "dustAttackIndex": {
                    "count": 9,
                    "total": 63,
                    "pct": 14
                  },
                  "stakingOpportunity": {
                    "idleSol": 42.1,
                    "stakeableSol": 42.05,
                    "yearlySol": 2.94,
                    "yearlyUsd": 441.9,
                    "apyPct": 7
                  },
                  "closeableAccounts": {
                    "total": 58,
                    "empty": 31,
                    "nonempty": 27,
                    "recoverableSol": 0.063,
                    "recoverableUsd": 9.46
                  },
                  "monthlyPnl": [],
                  "sharpe": {},
                  "lossAversion": {},
                  "streaks": {
                    "longest": 9,
                    "currentlyActive": 0,
                    "longestHourRun": 5
                  },
                  "failureBreakdown": {},
                  "tokenGraveyard": {},
                  "panicSells": {},
                  "hodlBenchmark": {},
                  "biggestDays": [],
                  "traderTags": [
                    {
                      "key": "pump-degen",
                      "label": "Pump.fun degen",
                      "tone": "orange"
                    }
                  ],
                  "cohorts": {
                    "total": 63,
                    "stillHolding": 15,
                    "bought": 41,
                    "top": [
                      {
                        "mint": "DezX...",
                        "symbol": "BONK",
                        "name": "Bonk",
                        "image": "...",
                        "priceUsd": 0.00002,
                        "buys": 4,
                        "sells": 3,
                        "receives": 1,
                        "sends": 0,
                        "wasBought": true,
                        "realisedSol": 0.8,
                        "realisedUsd": 120,
                        "stillHolds": true,
                        "firstBuyTs": 1700000000,
                        "lastActivityTs": 1717200000,
                        "avgHoldHours": 36.2
                      }
                    ]
                  },
                  "trades": {
                    "wins": [],
                    "losses": []
                  },
                  "counterparties": [
                    {
                      "addr": "9WzD...AWWM",
                      "inLamports": 0,
                      "outLamports": 500000000,
                      "count": 3,
                      "swapTouches": 0,
                      "totalLamports": 500000000,
                      "netLamports": -500000000,
                      "flavor": "transfer",
                      "label": "Coinbase",
                      "kind": "cex"
                    }
                  ],
                  "holdings": {
                    "totalUsd": 12834.55,
                    "tokenCount": 7,
                    "dustBags": 3,
                    "topBags": [
                      {
                        "symbol": "BONK",
                        "name": "Bonk",
                        "mint": "DezX...",
                        "balance": 1500000,
                        "usd": 420.5,
                        "price": 0.00002,
                        "change24h": -3.1,
                        "allocation": 3.2
                      }
                    ],
                    "worst24h": {
                      "symbol": "BONK",
                      "change24h": -3.1,
                      "delta": -13
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream error during assembly (Stryke's node layer/the market-data layer failure surfaced as err.message"
          },
          "503": {
            "description": "profile provider not configured (Stryke's node layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/wrapped": {
      "get": {
        "summary": "Wallet wrapped (year-in-review)",
        "description": "The interpretive 'wrapped' layer built on top of profile.the assembler. Maps the deep profile onto a WrappedStats object, a WalletDiagnostics object, and a wallet classification — the gentle year-in-review (no roast verdict). Reuses the same profile cache so a /profile -> /wrapped burst hits cache.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-wrapped",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "deep"
            },
            "description": "'fast' (2 Stryke's node layer pages) or 'deep' (5 pages, default). Same semantics as /profile."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "One-year-window scoping. Snapped to nearest day (floor(since/86400)*86400). Non-finite/<=0 ignored. Used to build both the profile and wrapped cache keys."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response is {success:true, wallet, depth, stats, diagnostics, classification}. stats is Stryke's WrappedStats (address, txCount, swapCount, transferCount[always 0 GAP], failedCount, totalFeesLamports, totalPriorityFeesLamports, totalJitoTipsLamports, totalSolMovedLamports, biggestTx/biggestLossTx/oldestTx/newestTx [null GAPs], uniquePrograms, uniqueTokens, topPrograms[], topTokens[], busiestDay, jitoTipCount, dustAttacks[0 GAP], oneLiner). diagnostics is WalletDiagnostics (bot-fee fields are 0/[] GAPs, plus closeableAccounts, recoverableLamports, solBalanceLamports, pumpFunBuys[approx from dexBreakdown], walletAgeDays, lateNightSwapPct, topProgramPct, portfolio, topBag*, worstPerformer*, etc). classification is {kind,label,blurb,confidence}. No 'roast' key (see /roast).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "string"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "txCount": {
                          "type": "number"
                        },
                        "swapCount": {
                          "type": "number"
                        },
                        "transferCount": {
                          "type": "number"
                        },
                        "failedCount": {
                          "type": "number"
                        },
                        "totalFeesLamports": {
                          "type": "number"
                        },
                        "totalPriorityFeesLamports": {
                          "type": "number"
                        },
                        "totalJitoTipsLamports": {
                          "type": "number"
                        },
                        "totalSolMovedLamports": {
                          "type": "number"
                        },
                        "biggestTx": {},
                        "biggestLossTx": {},
                        "oldestTx": {},
                        "newestTx": {},
                        "uniquePrograms": {
                          "type": "number"
                        },
                        "uniqueTokens": {
                          "type": "number"
                        },
                        "topPrograms": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "topTokens": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "busiestDay": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "count": {
                              "type": "number"
                            }
                          }
                        },
                        "jitoTipCount": {
                          "type": "number"
                        },
                        "dustAttacks": {
                          "type": "number"
                        },
                        "oneLiner": {
                          "type": "string"
                        }
                      }
                    },
                    "diagnostics": {
                      "type": "object",
                      "properties": {
                        "botFeesLamports": {
                          "type": "number"
                        },
                        "botFeeCount": {
                          "type": "number"
                        },
                        "topBots": {
                          "type": "array",
                          "items": {}
                        },
                        "totalTokenAccounts": {
                          "type": "number"
                        },
                        "closeableAccounts": {
                          "type": "number"
                        },
                        "recoverableLamports": {
                          "type": "number"
                        },
                        "hasStake": {
                          "type": "boolean"
                        },
                        "stakedLamports": {
                          "type": "number"
                        },
                        "solBalanceLamports": {
                          "type": "number"
                        },
                        "rapidRoundTrips": {
                          "type": "number"
                        },
                        "duplicateBuys": {
                          "type": "array",
                          "items": {}
                        },
                        "uniqueShitcoins": {
                          "type": "number"
                        },
                        "biggestLossSig": {
                          "type": "string"
                        },
                        "biggestLossLamports": {
                          "type": "number"
                        },
                        "pumpFunBuys": {
                          "type": "number"
                        },
                        "walletAgeDays": {
                          "type": "number"
                        },
                        "walletAgeIsLowerBound": {
                          "type": "boolean"
                        },
                        "totalTxAllTime": {
                          "type": "number"
                        },
                        "failedTxAllTime": {
                          "type": "number"
                        },
                        "busiestDayAllTime": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "count": {
                              "type": "number"
                            }
                          }
                        },
                        "hourHistogram": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "lateNightSwapPct": {
                          "type": "number"
                        },
                        "avgGasPerSwapLamports": {
                          "type": "number"
                        },
                        "nftActivityCount": {
                          "type": "number"
                        },
                        "selfTransferCount": {
                          "type": "number"
                        },
                        "topProgramId": {
                          "type": "string"
                        },
                        "topProgramCount": {
                          "type": "number"
                        },
                        "topProgramPct": {
                          "type": "number"
                        },
                        "longestStreakDays": {
                          "type": "number"
                        },
                        "totalNotionalLamports": {
                          "type": "number"
                        },
                        "portfolio": {
                          "type": "object",
                          "properties": {
                            "totalUsd": {
                              "type": "number"
                            },
                            "assets": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "topBagSymbol": {
                          "type": "string"
                        },
                        "topBagUsd": {
                          "type": "number"
                        },
                        "dustBagsCount": {
                          "type": "number"
                        },
                        "worstPerformerSymbol": {
                          "type": "string"
                        },
                        "worstPerformerChange24h": {
                          "type": "number"
                        },
                        "chronicBagsCount": {
                          "type": "number"
                        }
                      }
                    },
                    "classification": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "blurb": {
                          "type": "string"
                        },
                        "confidence": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "depth": "deep",
                  "stats": {
                    "address": "6Yg9...M3kP",
                    "txCount": 487,
                    "swapCount": 214,
                    "transferCount": 0,
                    "failedCount": 18,
                    "totalFeesLamports": 3100000,
                    "totalPriorityFeesLamports": 600000,
                    "totalJitoTipsLamports": 800000,
                    "totalSolMovedLamports": 182400000000,
                    "biggestTx": null,
                    "biggestLossTx": null,
                    "oldestTx": null,
                    "newestTx": null,
                    "uniquePrograms": 7,
                    "uniqueTokens": 63,
                    "topPrograms": [
                      {
                        "id": "JUP6Lkb...",
                        "count": 120
                      }
                    ],
                    "topTokens": [
                      {
                        "mint": "DezX...",
                        "count": 8
                      }
                    ],
                    "busiestDay": {
                      "date": "2026-03-14",
                      "count": 41
                    },
                    "jitoTipCount": 12,
                    "dustAttacks": 0,
                    "oneLiner": "214 swaps. Burned ◎0.003 in fees. Therapy?"
                  },
                  "diagnostics": {
                    "botFeesLamports": 0,
                    "botFeeCount": 0,
                    "topBots": [],
                    "totalTokenAccounts": 58,
                    "closeableAccounts": 31,
                    "recoverableLamports": 63000000,
                    "hasStake": false,
                    "stakedLamports": 0,
                    "solBalanceLamports": 42100000000,
                    "rapidRoundTrips": 0,
                    "duplicateBuys": [],
                    "uniqueShitcoins": 41,
                    "biggestLossSig": "5x...",
                    "biggestLossLamports": 2400000000,
                    "pumpFunBuys": 62,
                    "walletAgeDays": 214,
                    "walletAgeIsLowerBound": false,
                    "totalTxAllTime": 0,
                    "failedTxAllTime": 0,
                    "busiestDayAllTime": {
                      "date": "2026-03-14",
                      "count": 41
                    },
                    "hourHistogram": [
                      3,
                      1,
                      0
                    ],
                    "lateNightSwapPct": 0.18,
                    "avgGasPerSwapLamports": 42000,
                    "nftActivityCount": 2,
                    "selfTransferCount": 4,
                    "topProgramId": "JUP6Lkb...",
                    "topProgramCount": 120,
                    "topProgramPct": 0.56,
                    "longestStreakDays": 9,
                    "totalNotionalLamports": 182400000000,
                    "portfolio": {
                      "totalUsd": 12834.55,
                      "assets": []
                    },
                    "topBagSymbol": "BONK",
                    "topBagUsd": 420.5,
                    "dustBagsCount": 3,
                    "worstPerformerSymbol": "BONK",
                    "worstPerformerChange24h": -3.1,
                    "chronicBagsCount": 0
                  },
                  "classification": {
                    "kind": "active_trader",
                    "label": "Active trader",
                    "blurb": "214 swaps across 63 tokens. Fully online.",
                    "confidence": 0.8
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream error during assembly/mapping"
          },
          "503": {
            "description": "profile provider not configured (Stryke's node layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/roast": {
      "get": {
        "summary": "Wallet roast (wrapped + verdict)",
        "description": "Everything /wrapped returns PLUS a roast verdict object (headline, burns, receipts, actions, lScore, tweetText) — the full output Stryke's /roast page assembles. Same cache/cost profile as /wrapped.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-roast",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "deep"
            },
            "description": "'fast' (2 Stryke's node layer pages) or 'deep' (5 pages, default)."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "One-year-window scoping. Snapped to nearest day. Non-finite/<=0 ignored. Builds both profile and roast cache keys."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response is {success:true, wallet, depth, stats, diagnostics, classification, roast} — identical to /wrapped plus the roast key. roast is roastFromStats() output: headline (string, the highest-scoring verdict from pickVerdict), burns (string[]), receipts (array of {label,value,hint?,scope?}), actions (array of {kind,label,href,reason,potentialSavings?} — kinds: stryke/close/solfolio/wrapped, with affiliate UTM-wrapped hrefs), lScore (integer 1..99), tweetText (string). For a zero-tx wallet roast returns a fixed pristine-wallet verdict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "string"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "txCount": {
                          "type": "number"
                        },
                        "swapCount": {
                          "type": "number"
                        },
                        "failedCount": {
                          "type": "number"
                        },
                        "uniqueTokens": {
                          "type": "number"
                        },
                        "uniquePrograms": {
                          "type": "number"
                        },
                        "oneLiner": {
                          "type": "string"
                        }
                      }
                    },
                    "diagnostics": {
                      "type": "object",
                      "properties": {
                        "botFeesLamports": {
                          "type": "number"
                        },
                        "closeableAccounts": {
                          "type": "number"
                        },
                        "recoverableLamports": {
                          "type": "number"
                        },
                        "solBalanceLamports": {
                          "type": "number"
                        },
                        "hasStake": {
                          "type": "boolean"
                        },
                        "pumpFunBuys": {
                          "type": "number"
                        },
                        "lateNightSwapPct": {
                          "type": "number"
                        },
                        "biggestLossLamports": {
                          "type": "number"
                        },
                        "biggestLossSig": {
                          "type": "string"
                        },
                        "walletAgeDays": {
                          "type": "number"
                        },
                        "topProgramPct": {
                          "type": "number"
                        },
                        "dustBagsCount": {
                          "type": "number"
                        }
                      }
                    },
                    "classification": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "blurb": {
                          "type": "string"
                        },
                        "confidence": {
                          "type": "number"
                        }
                      }
                    },
                    "roast": {
                      "type": "object",
                      "properties": {
                        "headline": {
                          "type": "string"
                        },
                        "burns": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "receipts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "hint": {
                                "type": "string"
                              },
                              "scope": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "href": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "potentialSavings": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "lScore": {
                          "type": "number"
                        },
                        "tweetText": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "6Yg9...M3kP",
                  "depth": "deep",
                  "stats": {
                    "address": "6Yg9...M3kP",
                    "txCount": 487,
                    "swapCount": 214,
                    "failedCount": 18,
                    "uniqueTokens": 63,
                    "uniquePrograms": 7,
                    "oneLiner": "214 swaps. Burned ◎0.003 in fees. Therapy?"
                  },
                  "diagnostics": {
                    "botFeesLamports": 0,
                    "closeableAccounts": 31,
                    "recoverableLamports": 63000000,
                    "solBalanceLamports": 42100000000,
                    "hasStake": false,
                    "pumpFunBuys": 62,
                    "lateNightSwapPct": 0.18,
                    "biggestLossLamports": 2400000000,
                    "biggestLossSig": "5x...",
                    "walletAgeDays": 214,
                    "topProgramPct": 0.56,
                    "dustBagsCount": 3
                  },
                  "classification": {
                    "kind": "active_trader",
                    "label": "Active trader",
                    "blurb": "214 swaps across 63 tokens. Fully online.",
                    "confidence": 0.8
                  },
                  "roast": {
                    "headline": "62 pump.fun buys. You didn't find gems — you became exit liquidity for the dev.",
                    "burns": [
                      "62 pump.fun buys. You didn't find gems — you found exit liquidity for the dev.",
                      "31 empty token accounts you forgot about — ◎0.063 (~$9.46) of rent locked in zombies.",
                      "◎42.10 idle, zero staked. ~$442/year of validator rewards you're leaving on the table."
                    ],
                    "receipts": [
                      {
                        "label": "Total TXs",
                        "value": "487",
                        "hint": "...",
                        "scope": "recent"
                      },
                      {
                        "label": "Swaps",
                        "value": "214",
                        "scope": "recent"
                      },
                      {
                        "label": "Fees burned",
                        "value": "◎0.003",
                        "scope": "recent"
                      }
                    ],
                    "actions": [
                      {
                        "kind": "close",
                        "label": "Reclaim ◎0.063 now",
                        "href": "/close-accounts",
                        "reason": "31 empty token accounts on your wallet. One signature, gas-only, the SOL flows back to you.",
                        "potentialSavings": "◎0.063 (~$9.46)"
                      },
                      {
                        "kind": "solfolio",
                        "label": "Stake on Solfolio — ~$442/yr",
                        "href": "https://solfolio.gg/?utm_source=Stryke&utm_medium=referral&utm_campaign=roast-no-stake",
                        "reason": "Your ◎42.10 earns nothing...",
                        "potentialSavings": "~$442/year at ~7% APY"
                      },
                      {
                        "kind": "wrapped",
                        "label": "See the gentle wrapped",
                        "href": "/wrapped/6Yg9...M3kP",
                        "reason": "Same data, no insults."
                      }
                    ],
                    "lScore": 47,
                    "tweetText": "L-Score 47/100\n\n62 pump.fun buys. You didn't find gems...\n\nroasted by @stryke_gg →"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream error during assembly/mapping"
          },
          "503": {
            "description": "profile provider not configured (Stryke's node layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/transfers": {
      "get": {
        "summary": "Wallet transfers / fund-flow",
        "description": "Raw token + native-SOL transfer edges decoded from Stryke's node layer enhanced transactions, for fund-flow tracing. Filterable by mint, counterparty, and direction. With ?synthetic=1, instead returns SYNTHESIZED swap trade rows (sanitized) in the same shape /:wallet/trades emits — for wallets a market provider misses.",
        "tags": [
          "Wallets"
        ],
        "operationId": "wallets-transfers",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Number of enhanced txs to scan (1-100, default 100)."
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Signature to paginate before (older txs)."
          },
          {
            "name": "mint",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only return transfer edges for this mint (transfer mode only)."
          },
          {
            "name": "counterparty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only edges where this address is the sender or receiver (transfer mode only)."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter edges by direction: 'in' or 'out' (transfer mode only)."
          },
          {
            "name": "synthetic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Set to '1' or 'true' to return synthesized swap trade rows instead of raw transfer edges."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default (transfer) mode: transfers[] of {signature, ts (epoch sec), mint, amount (UI units; SOL lamports/1e9), from, to, direction ('in' if wallet is recipient else 'out'), kind ('sol'|'token')}. Filters mint/counterparty/direction applied post-decode. With ?synthetic=1: returns {synthetic:true, count, trades[]} where each trade = {base_token, token0_address, token1_address, amount_base, amount_quote, side ('buy'|'sell'), date, hash} (only SWAP txs with both an input and output leg; QUOTE_MINTS = SOL/USDC/USDT treated as the quote side; sanitized). Enhanced-tx fetch cached 30s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signature": {
                            "type": "string"
                          },
                          "ts": {
                            "type": "number"
                          },
                          "mint": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                  "count": 2,
                  "transfers": [
                    {
                      "signature": "3xQ...",
                      "ts": 1719446400,
                      "mint": "So11111111111111111111111111111111111111112",
                      "amount": 1.25,
                      "from": "9aB...",
                      "to": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                      "direction": "in",
                      "kind": "sol"
                    },
                    {
                      "signature": "4yR...",
                      "ts": 1719446100,
                      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                      "amount": 150000,
                      "from": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                      "to": "7pH...",
                      "direction": "out",
                      "kind": "token"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Transfers unavailable (enhanced-tx upstream failed) — error \"transfers unavailable\""
          },
          "503": {
            "description": "transfers provider (Stryke's node layer) not configured"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/stake": {
      "get": {
        "summary": "Wallet native stake accounts",
        "description": "Native (SOL) stake accounts where the wallet is the withdrawer authority, read via Stake program getProgramAccounts (memcmp at offset 44). Returns per-account lamports/SOL, delegation state, vote account, active stake and rent-exempt flag, plus a total.",
        "tags": [
          "Wallets"
        ],
        "operationId": "wallets-stake",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (withdrawer authority)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "stakes[] of {stakeAccount, lamports, sol (lamports/1e9), state ('active'|'deactivating'|'inactive'), voteAccount (delegated validator or null), activeStakeSol (delegated stake/1e9, 0 if undelegated), rentExempt}. state is 'deactivating' when a non-a platform setting deactivationEpoch is set, 'active' when delegated, else 'inactive'. totalStakedSol sums stakes[].sol. Cached 120s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "totalStakedSol": {
                      "type": "number"
                    },
                    "stakes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stakeAccount": {
                            "type": "string"
                          },
                          "lamports": {
                            "type": "number"
                          },
                          "sol": {
                            "type": "number"
                          },
                          "state": {
                            "type": "string"
                          },
                          "voteAccount": {
                            "type": "string"
                          },
                          "activeStakeSol": {
                            "type": "number"
                          },
                          "rentExempt": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUiswQrAogwRGUS",
                  "count": 1,
                  "totalStakedSol": 102.5,
                  "stakes": [
                    {
                      "stakeAccount": "StAkEjQ...",
                      "lamports": 102500000000,
                      "sol": 102.5,
                      "state": "active",
                      "voteAccount": "Vote111...",
                      "activeStakeSol": 102,
                      "rentExempt": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Stake lookup unavailable (getProgramAccounts failed) — error \"stake lookup unavailable\""
          },
          "503": {
            "description": "stake provider (the node RPC) not configured"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/tx-stats": {
      "get": {
        "summary": "Wallet transaction stats",
        "description": "True lifetime-ish transaction and FAILED-tx counts from raw getSignaturesForAddress (the enhanced-tx feed omits failed txs and undercounts). Bounded pagination with a `capped` flag, plus age and failure-rate derived fields.",
        "tags": [
          "Wallets"
        ],
        "operationId": "wallets-tx-stats",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58)."
          },
          {
            "name": "pages",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max signature pages to scan, 1000 sigs each (1-50, default 10 = up to 10k sigs)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "totalTx = signatures scanned; failedCount = those with a non-null err; failureRatePct = failed/total*100 rounded to 0.1. oldestTs/newestTs are epoch seconds across the scanned window; ageDays from oldestTs rounded to 0.1 (null if no block times). capped is true when the page cap was hit (totals are a lower bound — increase pages); pagesScanned is how many 1000-sig pages were actually read. Cached 300s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "totalTx": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "failureRatePct": {
                      "type": "number"
                    },
                    "oldestTs": {
                      "type": "number"
                    },
                    "newestTs": {
                      "type": "number"
                    },
                    "ageDays": {
                      "type": "number"
                    },
                    "capped": {
                      "type": "boolean"
                    },
                    "pagesScanned": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                  "totalTx": 8423,
                  "failedCount": 312,
                  "failureRatePct": 3.7,
                  "oldestTs": 1659312000,
                  "newestTs": 1719446400,
                  "ageDays": 695.5,
                  "capped": false,
                  "pagesScanned": 9
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "tx-stats unavailable (getSignaturesForAddress failed) — error \"tx-stats unavailable\""
          },
          "503": {
            "description": "tx provider (Stryke's node layer) not configured"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/defi-positions": {
      "get": {
        "summary": "Wallet DeFi positions",
        "description": "Cross-protocol open DeFi positions for a Solana wallet — Kamino/Drift/Orca+Raydium LP, lending, and staking — each with USD value, deposits, borrows, and rewards. Complements /portfolio (spot holdings) and /stake (native stake) so net worth reflects money in DeFi, not just tokens.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-defi-positions",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "totalValueUSD": {
                      "type": "number"
                    },
                    "totalDepositedUSD": {
                      "type": "number"
                    },
                    "totalBorrowedUSD": {
                      "type": "number"
                    },
                    "totalRewardsUSD": {
                      "type": "number"
                    },
                    "protocolCount": {
                      "type": "number"
                    },
                    "protocols": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "positions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "token": {
                                  "type": "string"
                                },
                                "valueUSD": {
                                  "type": "number"
                                },
                                "apy": {
                                  "type": "number"
                                },
                                "pair": {
                                  "type": "string"
                                },
                                "inRange": {
                                  "type": "boolean"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "GDfn...7XmG",
                  "totalValueUSD": 12540.55,
                  "totalDepositedUSD": 11800,
                  "totalBorrowedUSD": 0,
                  "totalRewardsUSD": 42.11,
                  "protocolCount": 2,
                  "protocols": [
                    {
                      "name": "Kamino",
                      "type": "lending",
                      "positions": [
                        {
                          "token": "USDC",
                          "valueUSD": 8000,
                          "apy": 6.4
                        }
                      ]
                    },
                    {
                      "name": "Orca",
                      "type": "lp",
                      "positions": [
                        {
                          "pair": "SOL/USDC",
                          "valueUSD": 4540.55,
                          "inRange": true
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/pnl": {
      "get": {
        "summary": "Wallet PnL ledger",
        "description": "Per-token profit-and-loss / cost-basis ledger for ANY Solana wallet (not just bot users): realized & unrealized PnL, average buy/sell price, buy/sell volume + counts, and fees paid. Use it to rank whales and vet copy-trade targets on hard numbers.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-pnl",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Positions to return. Clamped 1..200."
          },
          {
            "name": "onlyOpen",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, only currently-held positions."
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field (e.g. totalPnlUSD, realizedPnlUSD)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "realizedPnlUSD": {
                          "type": "number"
                        },
                        "unrealizedPnlUSD": {
                          "type": "number"
                        },
                        "totalPnlUSD": {
                          "type": "number"
                        },
                        "totalFeesPaidUSD": {
                          "type": "number"
                        },
                        "winRate": {
                          "type": "number"
                        },
                        "wins": {
                          "type": "number"
                        },
                        "losses": {
                          "type": "number"
                        },
                        "positionCount": {
                          "type": "number"
                        }
                      }
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "logo": {
                            "type": "string"
                          },
                          "priceUSD": {
                            "type": "number"
                          },
                          "balance": {
                            "type": "number"
                          },
                          "valueUSD": {
                            "type": "number"
                          },
                          "buys": {
                            "type": "number"
                          },
                          "sells": {
                            "type": "number"
                          },
                          "avgBuyPriceUSD": {
                            "type": "number"
                          },
                          "avgSellPriceUSD": {
                            "type": "number"
                          },
                          "realizedPnlUSD": {
                            "type": "number"
                          },
                          "unrealizedPnlUSD": {
                            "type": "number"
                          },
                          "totalPnlUSD": {
                            "type": "number"
                          },
                          "totalFeesPaidUSD": {
                            "type": "number"
                          },
                          "volumeBuyUSD": {
                            "type": "number"
                          },
                          "volumeSellUSD": {
                            "type": "number"
                          },
                          "firstTradeAt": {
                            "type": "string"
                          },
                          "lastTradeAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "BHRE...G2AtX",
                  "count": 3,
                  "summary": {
                    "realizedPnlUSD": -44.63,
                    "unrealizedPnlUSD": 0,
                    "totalPnlUSD": -44.63,
                    "totalFeesPaidUSD": 3.59,
                    "winRate": 0,
                    "wins": 0,
                    "losses": 2,
                    "positionCount": 3
                  },
                  "positions": [
                    {
                      "mint": "8DhB...pump",
                      "symbol": "ROBBIN",
                      "name": "robbin the hood",
                      "logo": "https://...",
                      "priceUSD": 0.00000864,
                      "balance": 0,
                      "valueUSD": 0,
                      "buys": 7,
                      "sells": 1,
                      "avgBuyPriceUSD": 0.0000469,
                      "avgSellPriceUSD": 0.0000409,
                      "realizedPnlUSD": -9.94,
                      "unrealizedPnlUSD": 0,
                      "totalPnlUSD": -9.94,
                      "totalFeesPaidUSD": 2.12,
                      "volumeBuyUSD": 77.28,
                      "volumeSellUSD": 67.35,
                      "firstTradeAt": "2026-07-08T18:09:50Z",
                      "lastTradeAt": "2026-07-08T18:20:16Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/swaps": {
      "get": {
        "summary": "Wallet enriched swaps (MEV / fees)",
        "description": "Per-swap fee decomposition for a Solana wallet: total / gas / platform / MEV fee split plus the routing platform (e.g. axiom, gmgn, trojan). A forensics layer over the plain activity feed — surface sandwich exposure and where a wallet routes its trades.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-swaps",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). Validated; invalid returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Swaps to return. Clamped 1..200."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "desc"
            },
            "description": "'asc' or 'desc'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "swapCount": {
                          "type": "number"
                        },
                        "totalFeesUSD": {
                          "type": "number"
                        },
                        "gasFeesUSD": {
                          "type": "number"
                        },
                        "platformFeesUSD": {
                          "type": "number"
                        },
                        "mevFeesUSD": {
                          "type": "number"
                        },
                        "sandwichedCount": {
                          "type": "number"
                        },
                        "platforms": {
                          "type": "object",
                          "properties": {
                            "Padre": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "swaps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "txHash": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "baseMint": {
                            "type": "string"
                          },
                          "quoteMint": {
                            "type": "string"
                          },
                          "amountBase": {
                            "type": "number"
                          },
                          "amountQuote": {
                            "type": "number"
                          },
                          "amountUSD": {
                            "type": "number"
                          },
                          "totalFeesUSD": {
                            "type": "number"
                          },
                          "gasFeesUSD": {
                            "type": "number"
                          },
                          "platformFeesUSD": {
                            "type": "number"
                          },
                          "mevFeesUSD": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "BHRE...G2AtX",
                  "count": 11,
                  "summary": {
                    "swapCount": 11,
                    "totalFeesUSD": 3.8146,
                    "gasFeesUSD": 0.0901,
                    "platformFeesUSD": 2.866,
                    "mevFeesUSD": 0.8584,
                    "sandwichedCount": 0,
                    "platforms": {
                      "Padre": 11
                    }
                  },
                  "swaps": [
                    {
                      "txHash": "1pyS...GxvXa",
                      "date": "2026-07-08T18:20:15Z",
                      "type": "REGULAR",
                      "platform": "Padre",
                      "baseMint": "8DhB...pump",
                      "quoteMint": "So11...1112",
                      "amountBase": 1646405.92,
                      "amountQuote": 0.862,
                      "amountUSD": 0,
                      "totalFeesUSD": 0.7491,
                      "gasFeesUSD": 0.0081,
                      "platformFeesUSD": 0.6638,
                      "mevFeesUSD": 0.0772
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/sandwich-rollup": {
      "get": {
        "summary": "MEV sandwich loss rollup",
        "description": "How much a wallet lost to MEV sandwich bots across its recent swaps. Scans the wallet's recent swaps, keeps only the provider-flagged SANDWICHED ones (cap 25), and quantifies each via the per-tx MEV forensics engine (self-memoized per signature 24h) — returning confirmed sandwich events with victim loss, attacker, and extra slippage, plus a total. Route memoized 60s.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get-api-v2-wallets-wallet-sandwich-rollup",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58). 400 \"invalid wallet\" if invalid."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 40
            },
            "description": "How many recent swaps to scan (clamped 1-80). Only provider-flagged sandwiches among them are quantified (max 25 signatures)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "swapsScanned = swaps pulled for the wallet; providerFlagged = how many carried a SANDWICH tag; confirmed = how many the on-chain forensics engine actually confirmed as sandwiches; totalVictimLossQuote = summed victim loss across confirmed events, in the QUOTE asset (SOL or USDC of the sandwiched pair). Each events[] item: {signature, confidence, attacker, victimLossQuote, attackerProfitQuote, extraSlippagePct}. events is [] (and totals 0) when nothing is flagged/confirmed — verified live against an active trader (swapsScanned:40, providerFlagged:0, confirmed:0, events:[]); the populated event above is illustrative of the shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "swapsScanned": {
                      "type": "number"
                    },
                    "providerFlagged": {
                      "type": "number"
                    },
                    "confirmed": {
                      "type": "number"
                    },
                    "totalVictimLossQuote": {
                      "type": "number"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signature": {
                            "type": "string"
                          },
                          "confidence": {
                            "type": "string"
                          },
                          "attacker": {
                            "type": "string"
                          },
                          "victimLossQuote": {
                            "type": "number"
                          },
                          "attackerProfitQuote": {
                            "type": "number"
                          },
                          "extraSlippagePct": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "F7RV6aBWfniixoFkQNWmRwznDj2vae2XbusFfvMMjtbE",
                  "swapsScanned": 40,
                  "providerFlagged": 2,
                  "confirmed": 1,
                  "totalVictimLossQuote": 0.0184,
                  "events": [
                    {
                      "signature": "4xk9Qh…Qm",
                      "confidence": "high",
                      "attacker": "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCm",
                      "victimLossQuote": 0.0184,
                      "attackerProfitQuote": 0.0121,
                      "extraSlippagePct": 3.7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "{ success:false, error } — swaps/forensics upstream failure"
          },
          "503": {
            "description": "swaps provider not configured"
          }
        }
      }
    },
    "/api/v2/wallets/{wallet}/informed": {
      "get": {
        "summary": "Informed-buyer timing analysis",
        "description": "Measures whether a wallet's ENTRIES are consistently well timed: for each recent buy, compares the executed price against the peak of the following window (default 3h) and reports how often that move cleared the pump threshold (default +50%). Flags a wallet only when BOTH a minimum number of well-timed entries AND a minimum hit rate are met, so a prolific trader who caught a few pumps by volume alone does not qualify. Correlation, not proof — a skilled momentum trader scores the same as someone acting on information. Coverage fields report how much of the wallet's history could actually be priced; a low `coverage` means the verdict is inconclusive rather than clean. Cached 30 min per wallet + threshold set.",
        "tags": [
          "Wallets"
        ],
        "operationId": "wallets-informed",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Base58 wallet address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "`informed` is true only when evaluated >= minEvaluated AND wins >= minWins AND winRate >= minRate.\n\n`coverage` = evaluated / buysConsidered. Below ~0.5 treat the result as inconclusive, not clean.\n\n`unpriced` counts buys excluded because their forward window held too few price samples to trust.\n\n`medianSamplesPerWindow` is a data-quality readout — single-digit values mean thin price history.\n\nThresholds (window length, pump %, minimum wins and hit rate) are operator-tunable and are echoed in every response, so a client can always see which criteria produced the verdict rather than assuming defaults.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "informed": {
                      "type": "boolean"
                    },
                    "evaluated": {
                      "type": "number"
                    },
                    "buysConsidered": {
                      "type": "number"
                    },
                    "unpriced": {
                      "type": "number"
                    },
                    "wins": {
                      "type": "number"
                    },
                    "winRate": {
                      "type": "number"
                    },
                    "coverage": {
                      "type": "number"
                    },
                    "medianForwardPct": {
                      "type": "number"
                    },
                    "medianSamplesPerWindow": {
                      "type": "number"
                    },
                    "distinctTokens": {
                      "type": "number"
                    },
                    "windowHours": {
                      "type": "number"
                    },
                    "pumpPct": {
                      "type": "number"
                    },
                    "minWins": {
                      "type": "number"
                    },
                    "minRate": {
                      "type": "number"
                    },
                    "truncatedBuys": {
                      "type": "number"
                    },
                    "truncatedClusters": {
                      "type": "number"
                    },
                    "samples": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "ts": {
                            "type": "number"
                          },
                          "usd": {
                            "type": "number"
                          },
                          "entry": {
                            "type": "number"
                          },
                          "peak": {
                            "type": "number"
                          },
                          "forwardPct": {
                            "type": "number"
                          },
                          "tx": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "note": {}
                  }
                },
                "example": {
                  "success": true,
                  "ok": true,
                  "wallet": "52gGDyhdWLFDMAHvNsAxwYLNkQauVwQWJUNBmmRt7KJh",
                  "informed": false,
                  "evaluated": 22,
                  "buysConsidered": 38,
                  "unpriced": 1,
                  "wins": 1,
                  "winRate": 0.045,
                  "coverage": 0.58,
                  "medianForwardPct": 0.39,
                  "medianSamplesPerWindow": 13,
                  "distinctTokens": 11,
                  "windowHours": 3,
                  "pumpPct": 50,
                  "minWins": 5,
                  "minRate": 0.6,
                  "truncatedBuys": 0,
                  "truncatedClusters": 0,
                  "samples": [
                    {
                      "mint": "h5NciPdMZ5QCB5BYETJMYBMpVx9ZuitR6HcVjyBhood",
                      "symbol": "HOOD",
                      "ts": 1783521690040,
                      "usd": 146.91,
                      "entry": 0.0000061888,
                      "peak": 0.0000093972,
                      "forwardPct": 51.8,
                      "tx": "4PNaN4msGNGaWaurKx3kKyLc5Esgp27ptzuYfgtF9iS6X4zpoeG64AiMM31qGP7ub83QFWEwB1gyapyLCqJdCdbo"
                    }
                  ],
                  "note": null
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream the market-data layer error (known to occasionally 503 upstream"
          },
          "503": {
            "description": "trades provider not configured (the market-data layer key missing"
          }
        }
      }
    },
    "/api/v2/wallets/cohort": {
      "post": {
        "summary": "Wallet cohort analysis (submit)",
        "description": "Finds on-chain links between an ARBITRARY set of up to 100 wallets — no token mint involved. Traces each wallet's funding chain, direct transfers, shared funders, shared counterparties, common collectors and portfolio overlap, then clusters them into entities. Returns 202 with a jobId; poll GET /api/v2/wallets/cohort/{jobId} for progress and the result. A 100-wallet run typically completes in 15-60s. Identical address sets submitted within 10 minutes reuse the previous result (cached:true), and a concurrent identical submission joins the in-flight job instead of duplicating cost.",
        "tags": [
          "Wallets"
        ],
        "operationId": "post_api_v2_wallets_cohort",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "stage": {
                          "type": "string"
                        },
                        "done": {
                          "type": "number"
                        },
                        "total": {
                          "type": "number"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    },
                    "accepted": {
                      "type": "number"
                    },
                    "queuePosition": {},
                    "cached": {
                      "type": "boolean"
                    },
                    "reused": {
                      "type": "boolean"
                    },
                    "joined": {
                      "type": "boolean"
                    },
                    "parseInfo": {
                      "type": "object",
                      "properties": {
                        "invalid": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "duplicatesRemoved": {
                          "type": "number"
                        },
                        "overflowDropped": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "jobId": "kix-j2nbvZ_x",
                  "status": "queued",
                  "progress": {
                    "stage": "queued",
                    "done": 0,
                    "total": 100,
                    "pct": 0
                  },
                  "accepted": 100,
                  "queuePosition": null,
                  "cached": false,
                  "reused": false,
                  "joined": false,
                  "parseInfo": {
                    "invalid": [
                      {
                        "value": "oops",
                        "reason": "not_base58_pubkey"
                      }
                    ],
                    "duplicatesRemoved": 3,
                    "overflowDropped": 0
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "addresses": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "The wallets to analyse. Either an array of base58 pubkeys, or a single string with one address per line / comma / semicolon / whitespace separated (so a pasted CSV column or spreadsheet cell works). Duplicates are removed, unreadable entries are reported back in parseInfo rather than silently dropped, and the list is capped at COHORT_MAX_WALLETS (default 100). Minimum 2 valid addresses."
                  },
                  "refresh": {
                    "type": "boolean",
                    "description": "Set true to bypass the 10-minute result reuse and force a fresh analysis of the same address set."
                  }
                },
                "required": [
                  "addresses"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/wallets/cohort/{jobId}": {
      "get": {
        "summary": "Wallet cohort analysis (result)",
        "description": "Polls a cohort analysis. While running, returns status + progress (stage, done/total, pct). When status is 'done', includes the full result: a verdict (plain-language headline + tone), a cohesion score with its three components, the node/edge graph, clusters, BRIDGES (external addresses that connect wallets you supplied but did not include), the funding timeline, and coverage. Wallets whose history could not be read are returned in `unknown` — NOT in `isolated` — so unreadable data is never presented as evidence of independence. Returns 404 if the job expired (20min TTL) or the service restarted; resubmit in that case.",
        "tags": [
          "Wallets"
        ],
        "operationId": "get_api_v2_wallets_cohort_by_jobId",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The jobId returned by POST /api/v2/wallets/cohort."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "stage": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    },
                    "elapsedMs": {
                      "type": "number"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        },
                        "verdict": {
                          "type": "object",
                          "properties": {
                            "headline": {
                              "type": "string"
                            },
                            "tone": {
                              "type": "string"
                            },
                            "detail": {
                              "type": "string"
                            }
                          }
                        },
                        "cohesion": {
                          "type": "object",
                          "properties": {
                            "score": {
                              "type": "number"
                            },
                            "reachPct": {
                              "type": "number"
                            },
                            "largestGroupPct": {
                              "type": "number"
                            },
                            "evidenceStrength": {
                              "type": "number"
                            },
                            "linkedCount": {
                              "type": "number"
                            },
                            "groupCount": {
                              "type": "number"
                            },
                            "isolatedCount": {
                              "type": "number"
                            },
                            "unknownCount": {
                              "type": "number"
                            }
                          }
                        },
                        "nodes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "cohort": {
                                "type": "boolean"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "group": {
                                "type": "number"
                              },
                              "isolated": {
                                "type": "boolean"
                              },
                              "lamports": {
                                "type": "number"
                              },
                              "degree": {
                                "type": "number"
                              },
                              "funder": {
                                "type": "string"
                              },
                              "fundedAt": {
                                "type": "number"
                              },
                              "tokenCount": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "edges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "target": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "strength": {
                                "type": "number"
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "funder": {
                                    "type": "string"
                                  },
                                  "siblings": {
                                    "type": "number"
                                  },
                                  "amount": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "clusters": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "groupIndex": {
                                "type": "number"
                              },
                              "members": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "memberCount": {
                                "type": "number"
                              },
                              "confidence": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "bridges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "memberCount": {
                                "type": "number"
                              },
                              "linkTypes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "strength": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "isolated": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "unknown": {
                          "type": "array",
                          "items": {}
                        },
                        "timeline": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "t": {
                                "type": "number"
                              },
                              "lamports": {
                                "type": "number"
                              },
                              "group": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "coverage": {
                          "type": "object",
                          "properties": {
                            "traced": {
                              "type": "number"
                            },
                            "readable": {
                              "type": "number"
                            },
                            "holdingsRead": {
                              "type": "number"
                            },
                            "hubsMeasured": {
                              "type": "number"
                            },
                            "hubsInfra": {
                              "type": "number"
                            },
                            "infraEdgesDropped": {
                              "type": "number"
                            }
                          }
                        },
                        "edgeTypes": {
                          "type": "object",
                          "properties": {
                            "shared_funder": {
                              "type": "number"
                            },
                            "funding_chain": {
                              "type": "number"
                            }
                          }
                        },
                        "_degraded": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "jobId": "kix-j2nbvZ_x",
                  "status": "done",
                  "progress": {
                    "stage": "done",
                    "pct": 100
                  },
                  "elapsedMs": 15100,
                  "result": {
                    "ok": true,
                    "verdict": {
                      "headline": "32 of 100 wallets form 5 groups",
                      "tone": "warn",
                      "detail": "68 wallets showed no link to any other. 17 external addresses connect members you did not supply."
                    },
                    "cohesion": {
                      "score": 49,
                      "reachPct": 56,
                      "largestGroupPct": 15,
                      "evidenceStrength": 0.77,
                      "linkedCount": 56,
                      "groupCount": 5,
                      "isolatedCount": 68,
                      "unknownCount": 0
                    },
                    "nodes": [
                      {
                        "id": "7Bx...",
                        "cohort": true,
                        "kind": "wallet",
                        "group": 0,
                        "isolated": false,
                        "lamports": 41230000,
                        "degree": 3,
                        "funder": "9Fd...",
                        "fundedAt": 1784500000,
                        "tokenCount": 12
                      }
                    ],
                    "edges": [
                      {
                        "source": "7Bx...",
                        "target": "9Fd...",
                        "type": "shared_funder",
                        "strength": 0.8,
                        "evidence": {
                          "funder": "9Fd...",
                          "siblings": 4,
                          "amount": 250000000
                        }
                      }
                    ],
                    "clusters": [
                      {
                        "groupIndex": 0,
                        "members": [
                          "7Bx..."
                        ],
                        "memberCount": 15,
                        "confidence": "high"
                      }
                    ],
                    "bridges": [
                      {
                        "address": "iGd...",
                        "memberCount": 9,
                        "linkTypes": [
                          "shared_funder"
                        ],
                        "strength": 0.8
                      }
                    ],
                    "isolated": [
                      "5tz..."
                    ],
                    "unknown": [],
                    "timeline": [
                      {
                        "address": "7Bx...",
                        "t": 1784500000,
                        "lamports": 250000000,
                        "group": 0
                      }
                    ],
                    "coverage": {
                      "traced": 100,
                      "readable": 100,
                      "holdingsRead": 87,
                      "hubsMeasured": 17,
                      "hubsInfra": 0,
                      "infraEdgesDropped": 0
                    },
                    "edgeTypes": {
                      "shared_funder": 30,
                      "funding_chain": 42
                    },
                    "_degraded": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/market/lighthouse": {
      "get": {
        "summary": "Market lighthouse (24h Solana DEX stats)",
        "description": "Returns aggregate 24h trading activity across Solana DEXs — total USD volume (and its 24h change), trade/buy/sell counts, and total fees paid. Sourced from the market-data layer's market/lighthouse endpoint, reshaped into a flat object and cached 5 minutes.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-market-lighthouse",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys come straight from the handler (the API layer lines 19-27) which maps the market-data layer's data.total.* sub-objects: volumeUSD24h = total.volumeUSD['24h']; volumeUSD24hChange = total.volumeUSDChange['24h'] (a percent change, can be negative); trades24h/buys24h/sells24h = total.trades|buys|sells ['24h'] (raw counts); feesPaidUSD24h = total.feesPaidUSD['24h']. Every field defaults to 0 if the upstream sub-key is missing, so the shape is stable even on partial upstream data. generatedAt is Date.now() captured when the cache entry was built (not per-request — value is reused for up to 5 minutes). success:true is spread alongside the data fields. Result is memoized under cache key 'lighthouse' for 5 minutes (300000 ms).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "volumeUSD24h": {
                      "type": "number"
                    },
                    "volumeUSD24hChange": {
                      "type": "number"
                    },
                    "trades24h": {
                      "type": "number"
                    },
                    "buys24h": {
                      "type": "number"
                    },
                    "sells24h": {
                      "type": "number"
                    },
                    "feesPaidUSD24h": {
                      "type": "number"
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "volumeUSD24h": 1284533019.42,
                  "volumeUSD24hChange": -3.71,
                  "trades24h": 18452310,
                  "buys24h": 9421005,
                  "sells24h": 9031305,
                  "feesPaidUSD24h": 4123880.55,
                  "generatedAt": 1749859200000
                }
              }
            }
          },
          "401": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "502": {
            "description": "Error"
          },
          "503": {
            "description": "Error"
          }
        }
      }
    },
    "/api/v2/market/sol-price": {
      "get": {
        "summary": "Canonical SOL/USD price",
        "description": "Returns the current SOL/USD spot price with a multi-source fallback chain: 30s in-memory cache → the price store DB table (accepted up to 10 min old) → Jupiter lite price API → $120 hard fallback. Always resolves to a price.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-market-sol-price",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Fields from the API layer lines 42-48: price (number, USD); source is one of 'db' | 'jupiter' | 'fallback' indicating which tier of the chain produced the value (DB row from the shared the price store table; live Jupiter lite-api fetch; or the $120 hard fallback constant); recordedAt is epoch-ms — for 'db' it's the row's recorded_at, for 'jupiter'/'fallback' it's Date.now() at fetch time; generatedAt is Date.now() at response build. price/source/recordedAt come from solPrice.getSolPrice (Stryke's engine), memoized in-process under key 'solPrice:v2' for 30 s. On a DB miss, a live Jupiter price is fetched and opportunistically written back to the DB (fire-and-forget) so the next caller sees it. When source='fallback', price is exactly 120.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "price": {
                      "type": "number"
                    },
                    "source": {
                      "type": "string"
                    },
                    "recordedAt": {
                      "type": "number"
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "price": 148.27,
                  "source": "db",
                  "recordedAt": 1749858960000,
                  "generatedAt": 1749859200000
                }
              }
            }
          },
          "401": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "502": {
            "description": "Error"
          }
        }
      }
    },
    "/api/v2/market/sol-price/history": {
      "get": {
        "summary": "SOL/USD price history",
        "description": "SOL/USD price time-series for charting, over a chosen range. Returns an array of [timestamp_ms, priceUsd] points (ascending), downsampled to at most 300 points. Range-specific cache TTLs.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-market-sol-price-history",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "24h"
            },
            "description": "One of: 1h, 24h, 7d, 30d. Any other value falls back to 24h. Determines lookback + native candle period (1h→5m, 24h/7d→1h, 30d→1d) and cache TTL (1h→60s, 24h→5m, 7d→15m, 30d→30m)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "points is an array of [t, p] pairs: t = epoch-ms, p = SOL/USD price (> 0), sorted ascending. Non-finite or non-positive samples are dropped. When the raw series exceeds 300 points it is evenly downsampled to 300, with the true last sample always kept as the \"now\" end. generatedAt = Date.now() at response build. range echoes the effective range after fallback.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "range": {
                      "type": "string"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "range": "24h",
                  "points": [
                    [
                      1783519200000,
                      77.077
                    ],
                    [
                      1783522800000,
                      76.621
                    ],
                    [
                      1783566000000,
                      77.042
                    ]
                  ],
                  "generatedAt": 1783604500000
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "{ success:false, error } — history upstream failure"
          },
          "503": {
            "description": "history provider not configured"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/chart": {
      "get": {
        "summary": "Token price chart (OHLCV / price history)",
        "description": "Returns a time-series of {t,v} price points for a mint from the market-data layer market history, suitable for candle/line charts. Cached 30s per (mint,period,from,to).",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-tokens-mint-chart",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1d"
            },
            "description": "Time bucket. Allowed: 1h, 1d, 7d, 30d, 90d, 365d. Any other value silently falls back to 1d."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Start timestamp (ms epoch, passed via Number()). Optional."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "End timestamp (ms epoch, passed via Number()). Optional."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level: mint, period (resolved/clamped; accepts `interval` as an alias), from, to (resolved window, ms), points[], resolution ('candles'|'resampled'). Each point: t (unix-ms) and v (price). Provider-agnostic via the shared resolver (price history sourced primarily from the market-data layer, with a free pool-OHLCV fallback so pump.fun mints chart). No 503 gate — serves from the free fallback when the primary key is absent/empty. Empty series → points:[].",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "from": {},
                    "to": {},
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "t": {
                            "type": "number"
                          },
                          "v": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "period": "1d",
                  "from": null,
                  "to": null,
                  "points": [
                    {
                      "t": 1718236800000,
                      "v": 0.00002098
                    },
                    {
                      "t": 1718240400000,
                      "v": 0.00002131
                    },
                    {
                      "t": 1718244000000,
                      "v": 0.00002145
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "all price providers failed (success:false, neutral error message"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/ohlcv": {
      "get": {
        "summary": "OHLCV candles",
        "description": "Open/high/low/close price candles, resampled from the price series into a fixed number of equal-width time buckets over the requested period. Use this for charting libraries that expect candle arrays (the /chart endpoint returns a raw price line). Cached 30s.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-tokens-mint-ohlcv",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1d"
            },
            "description": "Look-back window. Allowed: 1h, 1d, 7d, 30d, 90d, 365d. Any other value falls back to 1d."
          },
          {
            "name": "buckets",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 80
            },
            "description": "Number of candles to resample the window into. Clamped to 10–300."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Provider-agnostic. Top-level adds resolution ('candles'|'resampled') + count + from/to. candles[] ascending by time, each { t (epoch ms), o, h, l, c (USD), v (USD volume | null) }. resolution 'candles' = REAL OHLCV+volume from the free pool-OHLCV fallback (covers pump.fun mints), passed through natively (NOT re-bucketed); 'resampled' = OHLC derived from market-data-layer price points (v:null) into `buckets` equal windows. Accepts `interval` as a period alias and from/to (ms) to override the window. No 503 gate; empty series → candles:[] (never 404). Vendor-neutral body+errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "candles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "t": {
                            "type": "number"
                          },
                          "o": {
                            "type": "number"
                          },
                          "h": {
                            "type": "number"
                          },
                          "l": {
                            "type": "number"
                          },
                          "c": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                  "period": "7d",
                  "candles": [
                    {
                      "t": 1780851600000,
                      "o": 1.001118547486874,
                      "h": 1.001558704722558,
                      "l": 1.001056092751251,
                      "c": 1.001337928925851
                    },
                    {
                      "t": 1780912020000,
                      "o": 1.001262843209248,
                      "h": 1.001283457234663,
                      "l": 1.000806125232852,
                      "c": 1.00082984511353
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "all price providers failed (success:false, neutral error message"
          }
        }
      }
    },
    "/api/v2/market/pool-ohlcv": {
      "get": {
        "summary": "Per-pool OHLCV candles",
        "description": "OHLCV candles for a SPECIFIC liquidity pool address (not the token aggregate). For a token live on several pools (e.g. a graduated pump.fun token on both PumpSwap and Raydium), chart the exact venue a user trades.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-market-pool-ohlcv",
        "parameters": [
          {
            "name": "pool",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Pool / pair address (base58). Get one from a token markets lookup."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            },
            "description": "Candle period: 1m,5m,1h,1d,1w."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200
            },
            "description": "Candles to return. Max 2000."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Start time (ms epoch)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "End time (ms epoch)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": " Response is normalised (numbers coerced, vendor bloat stripped) and Solana-focused; includes a derived summary where applicable. A \"stale\":true flag appears if served from the resilience cache during an upstream hiccup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "pool": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "candles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "t": {
                            "type": "number"
                          },
                          "o": {
                            "type": "number"
                          },
                          "h": {
                            "type": "number"
                          },
                          "l": {
                            "type": "number"
                          },
                          "c": {
                            "type": "number"
                          },
                          "v": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "pool": "3Uwf...2Noc",
                  "period": "1h",
                  "count": 2,
                  "candles": [
                    {
                      "t": 1783530000000,
                      "o": 0.00000401,
                      "h": 0.00000406,
                      "l": 0.00000392,
                      "c": 0.00000402,
                      "v": 22419.09
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/tokens/{mint}/chart-source": {
      "get": {
        "summary": "Chart embed source resolver",
        "description": "Resolves a ready-to-embed iframe src for a mint's chart, with provider failover: the DEX index (established DEX pools) first, then the pool index (pre-migration pump.fun bonding curves). Cached 10 min.",
        "tags": [
          "Market & Charts"
        ],
        "operationId": "get-api-v2-tokens-mint-chart-source",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SPL token mint address (base58). 400 'invalid mint' if invalid."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success with a resolvable pool: success, mint, available:true, provider (which chart source answered — the value is that source's own host, which is also where src and fullUrl point), src (embeddable iframe URL), fullUrl, pairAddress (the DEX index pairAddress or the pool index pool address). When no pool is found on either provider: {success:true, mint, available:false} (no provider/src). the DEX index wins if the mint has any own Solana pair (highest h24 volume); otherwise the pool index /networks/solana/tokens/{mint}/pools first pool is used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "src": {
                      "type": "string"
                    },
                    "fullUrl": {
                      "type": "string"
                    },
                    "pairAddress": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
                  "available": true,
                  "provider": "the DEX index",
                  "src": "https://dexscreener.com/solana/AbCd...?embed=1&theme=dark&trades=0&info=0&chartLeftToolbar=0",
                  "fullUrl": "https://dexscreener.com/solana/AbCd...",
                  "pairAddress": "AbCd..."
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "502": {
            "description": "upstream error (success:false, error message"
          }
        }
      }
    },
    "/api/v2/whales/labels": {
      "post": {
        "summary": "Bulk classify wallet labels",
        "description": "Bulk-classifies up to 100 wallet addresses, returning the market-data layer-derived smart-money flag tags (e.g. insider, dev, sniper, smart, fresh, bundler) plus known-entity name/type/logo and platform when available.",
        "tags": [
          "Whales"
        ],
        "operationId": "post-api-v2-whales-labels",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "success: always true on 200. count: number of wallets present in the labels map (= Object.keys(labels).length). labels: object keyed by wallet address; each value has wallet (address), entity (the market-data layer walletMetadata.entityName or null), entityType (walletMetadata.entityType or null), entityLogo (walletMetadata.entityLogo or null), platform (the market-data layer platform.name or null), and flags (the market-data layer labels[] array of smart-money tag strings, defaults to []). Only wallets the market-data layer returns data for appear in the map — addresses with no the market-data layer record are omitted, so count can be less than the number of wallets submitted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "labels": {
                      "type": "object",
                      "properties": {
                        "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1": {
                          "type": "object",
                          "properties": {
                            "wallet": {
                              "type": "string"
                            },
                            "entity": {
                              "type": "string"
                            },
                            "entityType": {
                              "type": "string"
                            },
                            "entityLogo": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "flags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU": {
                          "type": "object",
                          "properties": {
                            "wallet": {
                              "type": "string"
                            },
                            "entity": {},
                            "entityType": {},
                            "entityLogo": {},
                            "platform": {},
                            "flags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 2,
                  "labels": {
                    "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1": {
                      "wallet": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                      "entity": "Wintermute",
                      "entityType": "market_maker",
                      "entityLogo": "https://logos.marketData.io/wintermute.png",
                      "platform": "Raydium",
                      "flags": [
                        "smart",
                        "insider"
                      ]
                    },
                    "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU": {
                      "wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
                      "entity": null,
                      "entityType": null,
                      "entityLogo": null,
                      "platform": null,
                      "flags": [
                        "sniper"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "wallets[] required (max 100 valid addresses) — body.wallets missing/not an array or no valid addresses after filtering"
          },
          "401": {
            "description": "missing/invalid X-API-Key (validateApiKey: 'API key required. Include X-API-Key header.' or 'Invalid or inactive API key.'"
          },
          "403": {
            "description": "key domain restriction (request domain not in key's allowed_domains"
          },
          "429": {
            "description": "rate limit exceeded (>10 requests / 10s per key"
          },
          "502": {
            "description": "upstream the market-data layer error (handler catch → { success:false, error }"
          },
          "503": {
            "description": "labels provider not configured (the platform config unset"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallets": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of Solana wallet base58 addresses to classify. Invalid addresses (must match base58 32-44 chars) are filtered out, and the list is truncated to the first 100 valid addresses. If zero valid addresses remain after filtering, the request is rejected with 400."
                  }
                },
                "required": [
                  "wallets"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/whales/discover/{mint}": {
      "get": {
        "summary": "Discover whales in a token's top holders",
        "description": "Finds whale wallets among a token's largest holders: fetches the top-20 token accounts via the node RPC, resolves them to owner wallets, dedupes, then (if the market-data layer is configured) enriches and keeps only owners that carry smart-money flags or a known entity name. Result is cached in-process for 5 minutes per mint.",
        "tags": [
          "Whales"
        ],
        "operationId": "get-api-v2-whales-discover-mint",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana token mint address (base58, 32-44 chars). Validated with isAddr; an invalid value returns 400 'invalid mint'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "success: always true on 200. mint: echoed input mint. count: number of whales in the array. whales: array of whale objects — when the market-data layer is configured, each has wallet, entity (entityName or null), entityType (or null), entityLogo (or null), platform (platform.name or null), and flags (labels[]); only owners with at least one label OR a known entityName are included. When the market-data layer is NOT configured, whales is the raw deduped owner list as [{ wallet, flags: [] }] with no entity fields. generatedAt: epoch ms when the (cached) payload was generated — present only on the normal path; absent on the early empty-result returns ({ mint, count:0, whales:[] } when there are zero top token accounts or zero resolvable owners). Payload is memoized 5 min per mint key (whales:disc:<mint>), so generatedAt reflects cache build time, not request time.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "whales": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "wallet": {
                            "type": "string"
                          },
                          "entity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityLogo": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "platform": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                  "count": 2,
                  "whales": [
                    {
                      "wallet": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                      "entity": "Jump Trading",
                      "entityType": "market_maker",
                      "entityLogo": "https://logos.marketData.io/jump.png",
                      "platform": "Orca",
                      "flags": [
                        "smart"
                      ]
                    },
                    {
                      "wallet": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
                      "entity": null,
                      "entityType": null,
                      "entityLogo": null,
                      "platform": null,
                      "flags": [
                        "insider",
                        "bundler"
                      ]
                    }
                  ],
                  "generatedAt": 1718323200000
                }
              }
            }
          },
          "400": {
            "description": "invalid mint (mint param fails base58 validation"
          },
          "401": {
            "description": "missing/invalid X-API-Key (validateApiKey"
          },
          "403": {
            "description": "key domain restriction (request domain not in key's allowed_domains"
          },
          "429": {
            "description": "rate limit exceeded (>10 requests / 10s per key"
          },
          "502": {
            "description": "upstream error (handler catch → { success:false, error }) — e.g. the node RPC failure that escapes the inner.catch"
          },
          "503": {
            "description": "on-chain provider not configured (the platform config/the platform config unset"
          }
        }
      }
    },
    "/api/v2/whales/featured": {
      "get": {
        "summary": "Featured whales directory",
        "description": "Curated smart-money / whale directory, live-enriched via the market-data layer labels + portfolio. Returns net worth, asset count, top holdings and entity/flag metadata per wallet, filterable by category. Default category 'trader' so institutional CEX vaults don't dominate.",
        "tags": [
          "Whales"
        ],
        "operationId": "whales-featured",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter: 'trader' (default), 'cex', 'mm', 'validator', or 'all'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "whales[] of {wallet, entity (the market-data layer entityName or null), entityType, entityLogo, entityTwitter, platform, flags[] (raw the market-data layer labels), label (curated seed tag), category ('trader'|'cex'|'mm'|'validator', re-derived from entityType/name), netWorthUSD (clamped), assetCount, topAssets[] (top 3 by value, {symbol, logo, valueUSD})}. Sorted by netWorthUSD desc. category='all' returns every seed wallet. generatedAt is epoch ms. Underlying enrichment memoized 120s (shared with /leaderboard/featured).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "category": {
                      "type": "string"
                    },
                    "whales": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "wallet": {
                            "type": "string"
                          },
                          "entity": {},
                          "entityType": {},
                          "entityLogo": {},
                          "entityTwitter": {},
                          "platform": {},
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "label": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "netWorthUSD": {
                            "type": "number"
                          },
                          "assetCount": {
                            "type": "number"
                          },
                          "topAssets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "symbol": {
                                  "type": "string"
                                },
                                "logo": {
                                  "type": "string"
                                },
                                "valueUSD": {
                                  "type": "number"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "category": "trader",
                  "whales": [
                    {
                      "wallet": "DfMxre4cKmvogbLrPigxmibVTTQDuzjdXojWzjCXXhzj",
                      "entity": null,
                      "entityType": null,
                      "entityLogo": null,
                      "entityTwitter": null,
                      "platform": null,
                      "flags": [
                        "smart",
                        "pro_trader"
                      ],
                      "label": "Pro trader",
                      "category": "trader",
                      "netWorthUSD": 4820000,
                      "assetCount": 37,
                      "topAssets": [
                        {
                          "symbol": "SOL",
                          "logo": "https://...sol.png",
                          "valueUSD": 2100000
                        },
                        {
                          "symbol": "JUP",
                          "logo": "https://...jup.png",
                          "valueUSD": 640000
                        }
                      ]
                    }
                  ],
                  "generatedAt": 1719446400000
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "the market-data layer labels/portfolio upstream failed"
          },
          "503": {
            "description": "featured provider (the market-data layer) not configured"
          }
        }
      }
    },
    "/api/v2/leaderboard/featured": {
      "get": {
        "summary": "Featured leaderboard",
        "description": "Curated smart-money leaderboard ranking the same the market-data layer-enriched whale set as /whales/featured by net worth, reshaped into ranking rows. pnl30d/winRate are 0 placeholders — the market-data layer does not expose per-wallet realized PnL / win-rate here.",
        "tags": [
          "Whales"
        ],
        "operationId": "leaderboard-featured",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter: 'trader' (default), 'cex', 'mm', 'validator', or 'all'."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "leaders[] of {wallet, handle (entity or curated label), displayName (same), entityLogo, flags[], category, totalValue (=netWorthUSD), pnl30d (always 0 placeholder), winRate (always 0 placeholder), tradeCount (=assetCount)}. Only wallets with totalValue > 10 kept; sorted by totalValue desc. category='all' returns all. Reuses the /whales/featured 120s memo (one shared upstream fan-out). generatedAt is epoch ms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "category": {
                      "type": "string"
                    },
                    "leaders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "wallet": {
                            "type": "string"
                          },
                          "handle": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "entityLogo": {},
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "category": {
                            "type": "string"
                          },
                          "totalValue": {
                            "type": "number"
                          },
                          "pnl30d": {
                            "type": "number"
                          },
                          "winRate": {
                            "type": "number"
                          },
                          "tradeCount": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "category": "trader",
                  "leaders": [
                    {
                      "wallet": "DfMxre4cKmvogbLrPigxmibVTTQDuzjdXojWzjCXXhzj",
                      "handle": "Pro trader",
                      "displayName": "Pro trader",
                      "entityLogo": null,
                      "flags": [
                        "smart",
                        "pro_trader"
                      ],
                      "category": "trader",
                      "totalValue": 4820000,
                      "pnl30d": 0,
                      "winRate": 0,
                      "tradeCount": 37
                    }
                  ],
                  "generatedAt": 1719446400000
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "the market-data layer labels/portfolio upstream failed"
          },
          "503": {
            "description": "leaderboard provider (the market-data layer) not configured"
          }
        }
      }
    },
    "/api/v2/swap/quote": {
      "get": {
        "summary": "Get swap quote",
        "description": "Returns the best Jupiter swap route/quote for swapping `amount` base units of `inputMint` into `outputMint`. The returned quote object is required as input to POST /api/v2/swap/build.",
        "tags": [
          "Trading"
        ],
        "operationId": "get-api-v2-swap-quote",
        "parameters": [
          {
            "name": "inputMint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Mint address of the input (sell) token. Must be a valid base58 Solana address (32-44 chars). E.g. So11111111111111111111111111111111111111112 for SOL."
          },
          {
            "name": "outputMint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Mint address of the output (buy) token. Must be a valid base58 Solana address."
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Input amount in the token's smallest base units (e.g. lamports for SOL). Parsed with Number(); must be finite and > 0."
          },
          {
            "name": "slippageBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Allowed slippage in basis points. Coerced via Number() then clamped to [1, 10000]; falsy/NaN falls back to 50 (0.5%)."
          },
          {
            "name": "platformFeeBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional platform fee in basis points to embed in the quote. When provided, clamped to [0, 2500]; omitted from the upstream request when absent."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "`quote` is the verbatim Jupiter swap/v1 quote object. Key fields: `inAmount`/`outAmount` (base-unit strings), `otherAmountThreshold` (min received after slippage), `swapMode` (ExactIn/ExactOut), `slippageBps`, `priceImpactPct`, `platformFee` (null unless platformFeeBps was passed), and `routePlan[]` describing the AMM hops. The ENTIRE `quote` object must be passed back as `quoteResponse` to /swap/build.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "quote": {
                      "type": "object",
                      "properties": {
                        "inputMint": {
                          "type": "string"
                        },
                        "inAmount": {
                          "type": "string"
                        },
                        "outputMint": {
                          "type": "string"
                        },
                        "outAmount": {
                          "type": "string"
                        },
                        "otherAmountThreshold": {
                          "type": "string"
                        },
                        "swapMode": {
                          "type": "string"
                        },
                        "slippageBps": {
                          "type": "number"
                        },
                        "platformFee": {},
                        "priceImpactPct": {
                          "type": "string"
                        },
                        "routePlan": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "swapInfo": {
                                "type": "object",
                                "properties": {
                                  "ammKey": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "inputMint": {
                                    "type": "string"
                                  },
                                  "outputMint": {
                                    "type": "string"
                                  },
                                  "inAmount": {
                                    "type": "string"
                                  },
                                  "outAmount": {
                                    "type": "string"
                                  },
                                  "feeAmount": {
                                    "type": "string"
                                  },
                                  "feeMint": {
                                    "type": "string"
                                  }
                                }
                              },
                              "percent": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "contextSlot": {
                          "type": "number"
                        },
                        "timeTaken": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "quote": {
                    "inputMint": "So11111111111111111111111111111111111111112",
                    "inAmount": "100000000",
                    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                    "outAmount": "14982317",
                    "otherAmountThreshold": "14907405",
                    "swapMode": "ExactIn",
                    "slippageBps": 50,
                    "platformFee": null,
                    "priceImpactPct": "0.0012",
                    "routePlan": [
                      {
                        "swapInfo": {
                          "ammKey": "5quB...",
                          "label": "Whirlpool",
                          "inputMint": "So111...112",
                          "outputMint": "EPjF...Dt1v",
                          "inAmount": "100000000",
                          "outAmount": "14982317",
                          "feeAmount": "3000",
                          "feeMint": "So111...112"
                        },
                        "percent": 100
                      }
                    ],
                    "contextSlot": 293847123,
                    "timeTaken": 0.0123
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "502": {
            "description": "Error"
          }
        }
      }
    },
    "/api/v2/swap/build": {
      "post": {
        "summary": "Build swap transaction",
        "description": "Builds an UNSIGNED base64 swap transaction from a quote (from /swap/quote) and the user's public key. The caller signs and broadcasts it themselves; the API never holds keys.",
        "tags": [
          "Trading"
        ],
        "operationId": "post-api-v2-swap-build",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response spreads Jupiter swap/v1 /swap output alongside `success`. Primary field: `swapTransaction` — a base64-encoded UNSIGNED versioned transaction. Also typically includes `lastValidBlockHeight`, `prioritizationFeeLamports`, `computeUnitLimit`, and (when dynamic slippage is used) `dynamicSlippageReport`. The service hardcodes wrapAndUnwrapSol:true, useSharedAccounts:false, dynamicComputeUnitLimit:true on the upstream request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "swapTransaction": {
                      "type": "string"
                    },
                    "lastValidBlockHeight": {
                      "type": "number"
                    },
                    "prioritizationFeeLamports": {
                      "type": "number"
                    },
                    "computeUnitLimit": {
                      "type": "number"
                    },
                    "dynamicSlippageReport": {}
                  }
                },
                "example": {
                  "success": true,
                  "swapTransaction": "AQAAAAAAAAAA...base64-unsigned-vtx...",
                  "lastValidBlockHeight": 293848000,
                  "prioritizationFeeLamports": 12000,
                  "computeUnitLimit": 140000,
                  "dynamicSlippageReport": null
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "502": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "quoteResponse": {
                    "type": "object",
                    "description": "The full quote object returned by GET /swap/quote (the value of its `quote` field). Must be a non-null object."
                  },
                  "userPublicKey": {
                    "type": "string",
                    "description": "The wallet public key that will sign and own the swap. Must be a valid base58 Solana address."
                  },
                  "feeAccount": {
                    "type": "string",
                    "description": "Optional token account to collect the platform fee (must correspond to the platformFeeBps used in the quote). If present, must be a valid base58 address (else 400)."
                  },
                  "computeUnitPriceMicroLamports": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "description": "Optional priority fee (compute unit price) in micro-lamports. Forwarded to Jupiter only when truthy."
                  }
                },
                "required": [
                  "quoteResponse",
                  "userPublicKey"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/orders/limit/create": {
      "post": {
        "summary": "Create limit order",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Creates a Jupiter limit order and returns the UNSIGNED transaction to open it. Caller signs and broadcasts.",
        "tags": [
          "Trading"
        ],
        "operationId": "post-api-v2-orders-limit-create",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter limit/v2 createOrder output alongside `success`. Returns the new `order` account public key and the base64 UNSIGNED transaction (Jupiter returns this as `tx`) to open it. Exact field names are Jupiter lite-api limit/v2 passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "order": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "order": "7Yk2...orderPubkey",
                  "tx": "AQAAAAAA...base64-unsigned-tx..."
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputMint": {
                    "type": "string",
                    "description": "Mint to sell. Valid base58 Solana address."
                  },
                  "outputMint": {
                    "type": "string",
                    "description": "Mint to buy. Valid base58 Solana address."
                  },
                  "makingAmount": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Amount of inputMint to sell, in base units. Validated with Number() (must be finite)."
                  },
                  "takingAmount": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Amount of outputMint to receive, in base units (defines the limit price). Validated with Number() (must be finite)."
                  },
                  "maker": {
                    "type": "string",
                    "description": "Wallet that owns the order. If provided, must be a valid base58 address (else 400). Forwarded to Jupiter."
                  },
                  "payer": {
                    "type": "string",
                    "description": "Wallet that pays rent/fees for creating the order. Forwarded to Jupiter as-is (not address-validated by this service)."
                  }
                },
                "required": [
                  "inputMint",
                  "outputMint",
                  "makingAmount",
                  "takingAmount"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/orders/limit": {
      "get": {
        "summary": "List open limit orders",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Lists a wallet's currently open Jupiter limit orders.",
        "tags": [
          "Trading"
        ],
        "operationId": "get-api-v2-orders-limit",
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address whose open limit orders to fetch. Must be a valid base58 Solana address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter limit/v2 openOrders output alongside `success` (typically an `orders` array of {publicKey, account:{maker, inputMint, outputMint, makingAmount, takingAmount,...}}). Shape is the Jupiter lite-api openOrders passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true
      }
    },
    "/api/v2/orders/limit/history": {
      "get": {
        "summary": "Limit order history",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Returns a wallet's historical (filled/cancelled/expired) Jupiter limit orders.",
        "tags": [
          "Trading"
        ],
        "operationId": "get-api-v2-orders-limit-history",
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address whose limit-order history to fetch. Must be a valid base58 Solana address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter limit/v2 orderHistory output alongside `success` (typically an `orders` array including `status` and a `trades[]` fill log). Exact shape is the Jupiter lite-api orderHistory passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true
      }
    },
    "/api/v2/orders/limit/cancel": {
      "post": {
        "summary": "Cancel limit order",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Builds an UNSIGNED transaction to cancel an existing Jupiter limit order. Caller signs and broadcasts.",
        "tags": [
          "Trading"
        ],
        "operationId": "post-api-v2-orders-limit-cancel",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter limit/v2 cancelOrder output alongside `success`. Returns the base64 UNSIGNED cancellation transaction (Jupiter `tx`). Field names are the Jupiter lite-api passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "tx": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "tx": "AQAAAAAA...base64-unsigned-cancel-tx..."
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": [
                      "string",
                      "object"
                    ],
                    "description": "The limit order to cancel — the order account public key (or order object) returned by /limit/create or /limit. Required; missing -> 400. Forwarded to Jupiter as the request body field `order`."
                  },
                  "maker": {
                    "type": "string",
                    "description": "The order maker / owner wallet. Forwarded to Jupiter as-is (not address-validated by this service)."
                  }
                },
                "required": [
                  "order"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/orders/dca/create": {
      "post": {
        "summary": "Create DCA position",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Creates a Jupiter dollar-cost-average (DCA) position and returns the UNSIGNED transaction to open it. Caller signs and broadcasts.",
        "tags": [
          "Trading"
        ],
        "operationId": "post-api-v2-orders-dca-create",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter dca/v1 createDca output alongside `success`. Returns the new `dca` position account public key and the base64 UNSIGNED transaction (Jupiter `tx`) to open it. Field names are the Jupiter lite-api dca/v1 passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "dca": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "dca": "3Pq8...dcaPubkey",
                  "tx": "AQAAAAAA...base64-unsigned-tx..."
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputMint": {
                    "type": "string",
                    "description": "Mint to spend each cycle. Valid base58 Solana address."
                  },
                  "outputMint": {
                    "type": "string",
                    "description": "Mint to accumulate. Valid base58 Solana address."
                  },
                  "inAmount": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Total input amount to DCA across all cycles, in base units. Validated with Number() (must be finite)."
                  },
                  "cycleSecondsApart": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Seconds between each buy cycle. Validated with Number() (must be finite)."
                  },
                  "numberOfCycles": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Number of buy cycles to execute. Validated with Number() (must be finite)."
                  },
                  "user": {
                    "type": "string",
                    "description": "Wallet that owns the DCA position. If provided, must be a valid base58 address (else 400). Forwarded to Jupiter."
                  }
                },
                "required": [
                  "inputMint",
                  "outputMint",
                  "inAmount",
                  "cycleSecondsApart",
                  "numberOfCycles"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/orders/dca": {
      "get": {
        "summary": "List DCA positions",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Lists a wallet's Jupiter DCA positions.",
        "tags": [
          "Trading"
        ],
        "operationId": "get-api-v2-orders-dca",
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address whose DCA positions to fetch. Must be a valid base58 Solana address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter dca/v1 positions output alongside `success` (typically a positions array of {publicKey, account:{user, inputMint, outputMint, inAmountPerCycle, cycleFrequency, nextCycleAt,...}}). Shape is the Jupiter lite-api dca/v1 positions passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true
      }
    },
    "/api/v2/orders/dca/close": {
      "post": {
        "summary": "Close DCA position",
        "description": "RETIRED — every /api/v2/orders/* path now answers 501 {\"code\":\"orders_retired\"}: the upstream order APIs it proxied were removed and there is no replacement. Builds an UNSIGNED transaction to close an existing Jupiter DCA position and withdraw remaining funds. Caller signs and broadcasts.",
        "tags": [
          "Trading"
        ],
        "operationId": "post-api-v2-orders-dca-close",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreads Jupiter dca/v1 closeDca output alongside `success`. Returns the base64 UNSIGNED close transaction (Jupiter `tx`). Field names are the Jupiter lite-api passthrough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "tx": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "tx": "AQAAAAAA...base64-unsigned-close-tx..."
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "403": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          },
          "501": {
            "description": "orders_retired: every path under /api/v2/orders answers this"
          },
          "502": {
            "description": "Error"
          }
        },
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dca": {
                    "type": [
                      "string",
                      "object"
                    ],
                    "description": "The DCA position to close — the position account public key (or object) returned by /dca/create or /dca. Required; missing -> 400. Forwarded to Jupiter as the request body field `dca`."
                  },
                  "user": {
                    "type": "string",
                    "description": "The DCA position owner wallet. Forwarded to Jupiter as-is (not address-validated by this service)."
                  }
                },
                "required": [
                  "dca"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/launches/recent": {
      "get": {
        "summary": "List recent launches",
        "description": "Returns the most recently indexed token launches (newly created liquidity pools) sorted by indexed_at descending, optionally filtered to a single DEX. Backed by the trading-bot indexer's /v1/indexer/recent-pools, cached in-process for 5 seconds per DEX bucket.",
        "tags": [
          "Launches"
        ],
        "operationId": "get-api-v2-launches-recent",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Number of launches to return. Coerced via Number(); non-numeric / missing falls back to 50, then clamped to the inclusive range [1, 200] (Math.max(1, Math.min(200,...))). The upstream is always queried at the max (200) and the result is sliced on read, so e.g. limit=49 and limit=50 share one upstream call/cache entry."
          },
          {
            "name": "dex",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter to a single DEX. Lowercased before validation and must be one of an allow-list: pumpfun, pumpswap, raydium, raydium_cpmm, meteora, meteora_damm_v2, orca, bonk. Any other non-empty value returns 400. Omitted/empty means all DEXes (cache bucket 'all'). Sent upstream as dex_type."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level keys: success (always true on 200), count (length of the returned launches array after limit slicing), launches (array). Each launch object is produced by normaliseLaunchRow in Stryke's engine with these fields: mint (string, token mint address); poolAddress (string, mapped from upstream pool_address); dexType (string, from dex_type — one of the allow-list values); signature (string|null, creation tx signature); blockTime (number|null, on-chain block time as unix seconds, Number()-coerced); indexedAt (number, unix timestamp when the indexer recorded the pool, Number()-coerced, the DESC sort key); creator (string|null, creator wallet); name (string|null, empty strings coalesced to null); symbol (string|null); uri (string|null, metadata URI). If the upstream returns success!==true or a non-array data, or the call times out (4s) / fails, getRecentLaunches degrades to an empty array — so a 200 with count:0 and launches:[] is the normal 'no results / soft upstream degrade' shape rather than an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "launches": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "poolAddress": {
                            "type": "string"
                          },
                          "dexType": {
                            "type": "string"
                          },
                          "signature": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blockTime": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "indexedAt": {
                            "type": "number"
                          },
                          "creator": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "symbol": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "uri": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 2,
                  "launches": [
                    {
                      "mint": "7xKp9aF3qN8mD2vR4tWcYb1eS6hJ5gL0uZ3nX8kQwAp",
                      "poolAddress": "9mB2cV4nR6tY8uI1oP3aS5dF7gH9jK0lZ2xC4vB6nM8q",
                      "dexType": "pumpfun",
                      "signature": "4nQ8xZ2kL9mP1vR3tW5cY7bH6gJ0sD8fA2eS4uI6oK1pX3vB5nM7qR9tY2uI4oP6aS8",
                      "blockTime": 1749900000,
                      "indexedAt": 1749900003,
                      "creator": "GkP3vN8mD2qR4tWcYb1eS6hJ5gL0uZ3nX8kQwApF7xK",
                      "name": "Example Coin",
                      "symbol": "EXMPL",
                      "uri": "https://ipfs.io/ipfs/Qm.../meta.json"
                    },
                    {
                      "mint": "2vB5nM7qR9tY2uI4oP6aS8dF1gH3jK5lZ7xC9vB2nM4q",
                      "poolAddress": "5dF7gH9jK0lZ2xC4vB6nM8qR1tY3uI5oP7aS9dF2gH4j",
                      "dexType": "raydium_cpmm",
                      "signature": null,
                      "blockTime": null,
                      "indexedAt": 1749899987,
                      "creator": null,
                      "name": null,
                      "symbol": null,
                      "uri": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "dex provided but not in the allow-list; body {success:false, error:\"dex must be one of: pumpfun, pumpswap, raydium, raydium_cpmm, meteora, meteora_damm_v2, orca, bonk\"}"
          },
          "401": {
            "description": "missing or invalid X-API-Key (validateApiKey middleware, applied to all /api/v2 routes except /health"
          },
          "429": {
            "description": "per-API-key rate limit exceeded"
          },
          "502": {
            "description": "upstream/indexer error thrown during fetch or cache.memo; body {success:false, error:<err.message>}"
          },
          "503": {
            "description": "indexer not configured (the platform config unset, the indexer.configured() false); body {success:false, error:\"indexer not configured\"}"
          }
        }
      }
    },
    "/api/v2/rpc": {
      "post": {
        "summary": "JSON-RPC passthrough (Stryke's node layer mainnet)",
        "description": "Forwards a single or batched (max 25) read-only Solana JSON-RPC request to Stryke's node layer mainnet and returns the upstream response verbatim. Only allow-listed read-only methods are permitted (no transaction submission, signing, or subscriptions).",
        "tags": [
          "RPC"
        ],
        "operationId": "post-api-v2-rpc",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success the handler does NOT wrap the result — it pipes Stryke's node layer's raw body straight through with res.status(r.status).type(content-type).send(text). For a single call you get one JSON-RPC object {jsonrpc, id, result}; for a batch request you get an ARRAY of such objects. A method-level RPC failure comes back as Stryke's node layer's standard {jsonrpc, id, error:{code, message}} (often still HTTP 200, since this is an RPC-protocol error, not an HTTP error). The `result` payload shape is entirely method-dependent (e.g. getAccountInfo → {context, value}, getAsset → a DAS asset object, getSignaturesForAddress → an array of signature info). Errors RAISED BY THIS HANDLER (not Stryke's node layer) use a different shape: {success:false, error:\"<message>\"} — e.g. 400 {\"success\":false,\"error\":\"method foo not allowed\"}, 503 {\"success\":false,\"error\":\"rpc provider not configured\"}, 502 {\"success\":false,\"error\":\"<fetch error message>\"}. Note: HTTP status from Stryke's node layer is propagated as-is, so a malformed upstream request can surface a 4xx/5xx from Stryke's node layer with a node-shaped JSON-RPC error body rather than the {success:false} shape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "context": {
                          "type": "object",
                          "properties": {
                            "apiVersion": {
                              "type": "string"
                            },
                            "slot": {
                              "type": "number"
                            }
                          }
                        },
                        "value": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": "getBalance",
                  "result": {
                    "context": {
                      "apiVersion": "2.0.15",
                      "slot": 348925671
                    },
                    "value": 1499995000
                  }
                }
              }
            }
          },
          "400": {
            "description": "json body required; batch must be 1..25; each call needs a string method; method <m> not allowed) — {success:false,error}"
          },
          "401": {
            "description": "missing or invalid X-API-Key, via validateApiKey"
          },
          "429": {
            "description": "per-key rate limit exceeded, via apiLimiter"
          },
          "502": {
            "description": "upstream fetch to Stryke's node layer failed or timed out after 25s — {success:false,error:<message>}"
          },
          "503": {
            "description": "rpc provider not configured — the platform config unset — {success:false,error:'rpc provider not configured'}"
          },
          "5XX": {
            "description": "any HTTP error status returned by Stryke's node layer is propagated verbatim with Stryke's node layer's JSON-RPC error body"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "(root)": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ],
                    "description": "The JSON body is EITHER a single JSON-RPC 2.0 call object OR an array of such objects (batch). An array must contain 1..25 calls (MAX_BATCH=25); empty or >25 → 400. A null/absent body → 400 'json body required'. The whole body is JSON.stringify'd and forwarded verbatim to Stryke's node layer — Stryke's node layer returns results in the same single-vs-array shape as the request."
                  },
                  "method": {
                    "type": "string",
                    "description": "Per-call: the JSON-RPC method name. Must be a string (else 400 'each call needs a string method') and must be in the read-only allow-list (else 400 'method <m> not allowed'). Allowed: getAccountInfo, getMultipleAccounts, getProgramAccounts, getBalance, getTokenAccountBalance, getTokenAccountsByOwner, getTokenAccountsByDelegate, getTokenLargestAccounts, getTokenSupply, getSlot, getBlockHeight, getBlock, getEpochInfo, getLatestBlockhash, getRecentBlockhash, getMinimumBalanceForRentExemption, getSignatureStatuses, getTransaction, getTransactionCount, getInflationReward, getStakeActivation, getVoteAccounts, getClusterNodes, getHealth, getVersion, getGenesisHash, getIdentity, getAsset, getAssetBatch, getAssetsByOwner, getAssetsByGroup, getAssetsByAuthority, getAssetsByCreator, getAssetProof, getAssetProofBatch, searchAssets, getTokenAccounts, getNftEditions, getSignaturesForAsset, getSignaturesForAddress, simulateTransaction, getPriorityFeeEstimate, getTransfersByAddress."
                  },
                  "jsonrpc": {
                    "type": "string",
                    "description": "Per-call: JSON-RPC version, e.g. \"2.0\". Not validated by the handler (only `method` is checked) but forwarded verbatim to Stryke's node layer, which expects \"2.0\". Recommended to set it."
                  },
                  "id": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Per-call: client-chosen request id echoed back by Stryke's node layer in the matching response object. Forwarded verbatim; not validated."
                  },
                  "params": {
                    "type": [
                      "array",
                      "object"
                    ],
                    "description": "Per-call: method-specific JSON-RPC params, forwarded verbatim to Stryke's node layer (shape depends on the method — e.g. [address, {encoding}] for getAccountInfo, or {id: mint} for getAsset). Not validated by this handler."
                  }
                },
                "required": [
                  "(root)",
                  "method"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/stream": {
      "get": {
        "summary": "Realtime stream (WebSocket)",
        "description": "WebSocket gateway at wss://api.stryke.gg/api/v2/stream (also reachable as /stream). Opened via an HTTP GET Upgrade — NOT a normal request/response. PAID-TIER-ONLY: authenticate with a paid Trading-API key (rt_… on tier builder/scale/enterprise) or an operator-granted Data-API key; the free/self-registered tier and the public builder key are DENIED at upgrade (401). Subscribe to two channels — launches (new pools, optional dex filter) and token+mint (live per-mint trade tape). One shared reference-counted poller/feed per distinct topic fans out to all subscribers, so backend load scales with distinct topics, not client count. Per-connection topic caps and per-key connection caps are enforced from the caller's tier.",
        "tags": [
          "Streaming"
        ],
        "operationId": "get-api-v2-stream",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "API key for auth when headers are unavailable (browsers). Precedence at upgrade: Authorization: Bearer <key> → ?key= → X-API-Key header → Sec-WebSocket-Protocol. A paid rt_ Trading-API key or an operator-granted Data-API key is required; the public builder key is always denied."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Frame types: welcome (once, on connect — advertises channels + heartbeatSec) | snapshot (once per subscribe — the current window, up to 50 items) | update (deltas only — new items since last frame) | pong (reply to op:ping) | unsubscribed (ack) | error. launches item data is the raw indexed pool row (getRecentLaunches, ≤50, sorted by time). token trade object: { mint, signature, ts (epoch-ms), type (\"buy\"|\"sell\"), priceUsd, amountToken, amountQuote (SOL or USDC depending on the pair — same field on snapshot and update), amountUsd, trader, platform }. Trades dedup by signature; last 50 retained per topic. token topics are driven by a shared live trade WS when enabled, else a 3s poll; launches always polls the indexer every 3s. Protocol heartbeat: server pings every 30s and terminates sockets that miss a pong.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_note": {
                      "type": "string"
                    },
                    "on_connect": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "heartbeatSec": {
                          "type": "number"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "on_subscribe_snapshot": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "signature": {
                                "type": "string"
                              },
                              "ts": {
                                "type": "number"
                              },
                              "type": {
                                "type": "string"
                              },
                              "priceUsd": {
                                "type": "number"
                              },
                              "amountToken": {
                                "type": "number"
                              },
                              "amountQuote": {
                                "type": "number"
                              },
                              "amountUsd": {
                                "type": "number"
                              },
                              "trader": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "on_new_trade_update": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "signature": {
                                "type": "string"
                              },
                              "ts": {
                                "type": "number"
                              },
                              "type": {
                                "type": "string"
                              },
                              "priceUsd": {
                                "type": "number"
                              },
                              "amountToken": {
                                "type": "number"
                              },
                              "amountQuote": {
                                "type": "number"
                              },
                              "amountUsd": {
                                "type": "number"
                              },
                              "trader": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "on_ping": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "on_unsubscribe": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "on_error": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "_note": "Server→client text frames arrive in sequence (this field lists representative frames, not one object):",
                  "on_connect": {
                    "type": "welcome",
                    "channels": [
                      "launches",
                      "token"
                    ],
                    "heartbeatSec": 30,
                    "message": "Subscribe with {\"op\":\"subscribe\",\"channel\":\"launches\"} or {\"op\":\"subscribe\",\"channel\":\"token\",\"mint\":\"<mint>\"}"
                  },
                  "on_subscribe_snapshot": {
                    "channel": "token:G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                    "type": "snapshot",
                    "data": [
                      {
                        "mint": "G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                        "signature": "4xk9…Qm",
                        "ts": 1783569412000,
                        "type": "buy",
                        "priceUsd": 0.0000123,
                        "amountToken": 812344.5,
                        "amountQuote": 0.42,
                        "amountUsd": 32.6,
                        "trader": "B4sAAVYE9v5iadYXdNYUdD1LoqtJi7xELJiGvfLwkmJD",
                        "platform": "pumpfun"
                      }
                    ]
                  },
                  "on_new_trade_update": {
                    "channel": "token:G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                    "type": "update",
                    "data": [
                      {
                        "mint": "G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                        "signature": "9pQ…zR",
                        "ts": 1783569418000,
                        "type": "sell",
                        "priceUsd": 0.0000119,
                        "amountToken": 500000,
                        "amountQuote": 0.25,
                        "amountUsd": 18.9,
                        "trader": "HsBK95XGUpVD3ENufWapD3Jib6zodHE6xj3VLArNBX3v",
                        "platform": "pumpfun"
                      }
                    ]
                  },
                  "on_ping": {
                    "type": "pong"
                  },
                  "on_unsubscribe": {
                    "channel": "token:G6cHLEwYHyZJXBhKpSWMU6RUtcq9HM9UTn2cTEdKpump",
                    "type": "unsubscribed"
                  },
                  "on_error": {
                    "type": "error",
                    "error": "token subscription limit (2) reached for your plan"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (upgrade rejected: missing key, free/unknown tier, public builder key, or domain not in the key's allow-list"
          },
          "429": {
            "description": "Too Many Connections (per-key connection cap for your tier reached"
          },
          "503": {
            "description": "Service Unavailable (global connection ceiling reached — MAX_CONNS, default 500"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "op": {
                    "type": "string",
                    "description": "Client→server message op (JSON text frame): \"subscribe\" | \"unsubscribe\" | \"ping\". ping replies {type:\"pong\"} (app-level keepalive; separate from the 30s WS protocol ping/pong heartbeat)."
                  },
                  "channel": {
                    "type": "string",
                    "description": "Required for subscribe/unsubscribe: \"launches\" or \"token\"."
                  },
                  "dex": {
                    "type": "string",
                    "description": "launches channel only. Optional DEX filter; one of: pumpfun, pumpswap, raydium, raydium_cpmm, meteora, meteora_damm_v2, orca, bonk. Omit for all DEXes. Creates topic launches:<dex>."
                  },
                  "mint": {
                    "type": "string",
                    "description": "token channel only (REQUIRED there). Base58 SPL mint. Creates topic token:<mint> and counts against your plan's token-topic cap. launches subscriptions are free (do not count)."
                  }
                },
                "required": [
                  "op",
                  "channel"
                ]
              }
            }
          }
        }
      }
    },
    "/api/register": {
      "post": {
        "summary": "Register for API Key",
        "description": "Creates a new API key for a Solana wallet that has no existing active key. The plaintext key is returned exactly once and cannot be retrieved later (only a hash is stored). The fee_wallet defaults to the owner wallet. Rate-limited to 5 attempts per hour per IP.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-register",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "apiKey is the only time the plaintext key is exposed (server stores a hash via hashApiKey). dashboard is a convenience URL containing the wallet. feeStructure and nextSteps are static informational fields.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "apiKey": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "dashboard": {
                      "type": "string"
                    },
                    "feeStructure": {
                      "type": "object",
                      "properties": {
                        "totalFee": {
                          "type": "string"
                        },
                        "yourShare": {
                          "type": "string"
                        },
                        "platformShare": {
                          "type": "string"
                        }
                      }
                    },
                    "nextSteps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "apiKey": "stryke_8f3c...e21a",
                  "message": "API key created successfully. Save this key securely - it cannot be retrieved later.",
                  "dashboard": "https://api.stryke.gg/dashboard?wallet=4Nd1mY...",
                  "feeStructure": {
                    "totalFee": "15% of recovered SOL",
                    "yourShare": "75% of fee (11.25% of total recovered)",
                    "platformShare": "25% of fee (3.75% of total recovered)"
                  },
                  "nextSteps": [
                    "Save your API key securely - it will not be shown again",
                    "Use the SDK to integrate the widget into your website",
                    "Fees are automatically split when users recover SOL"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "The owner's Solana wallet address (base58). Validated by constructing a PublicKey; also used as the default fee wallet."
                  },
                  "email": {
                    "type": "string",
                    "description": "Contact email. If provided, must match a basic email regex or the request is rejected with 400."
                  },
                  "websiteUrl": {
                    "type": "string",
                    "description": "The integrator's website URL, stored on the key record. No format validation."
                  }
                },
                "required": [
                  "walletAddress"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/challenge": {
      "post": {
        "summary": "Request Wallet Signature Challenge",
        "description": "Step 1 of wallet ownership verification. Generates a unique nonce + human-readable message that the wallet must sign off-chain. The challenge is stored server-side keyed by wallet address and expires after 5 minutes. Used as the prerequisite for /api/regenerate-key and /api/auth/wallet-login.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-auth-challenge",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "The client must sign the exact `message` string (UTF-8) with the wallet's private key and submit the base58 signature to /api/regenerate-key or /api/auth/wallet-login. nonce is a 32-byte hex value. expiresIn is 300 seconds. Only one pending challenge per wallet is stored (a new request overwrites the previous one).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "nonce": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Stryke API Authentication\n\nWallet: 4Nd1mY...\nNonce: 9a2f...c1\nTimestamp: 1718323200000\n\nSign this message to verify wallet ownership. This signature will not trigger any blockchain transaction or cost any fees.",
                  "nonce": "9a2f4b...c1",
                  "expiresIn": 300
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "The Solana wallet address (base58) to issue a challenge for. Validated via PublicKey construction."
                  }
                },
                "required": [
                  "walletAddress"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/wallet-login": {
      "post": {
        "summary": "Wallet Login (Session Token)",
        "description": "Verifies a signature against the wallet's pending challenge and, if a matching active API key exists, issues a 1-hour dashboard session token. The session token authorizes /api/dashboard-session and /api/update-domains without exposing the API key. Returns key metadata and stats but never the plaintext API key.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-auth-wallet-login",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "sessionToken is a 32-byte hex value valid for 3600s (stored in an in-memory walletSessions Map, swept every 10 min). feeWalletBalance is in lamports via the node RPC and may be null if the balance lookup fails (non-fatal). allowedDomains is null when the key is unrestricted. On success the consumed challenge is deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "sessionToken": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "number"
                    },
                    "apiKey": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "feeWallet": {
                          "type": "string"
                        },
                        "feeWalletBalance": {
                          "type": "number"
                        },
                        "allowedDomains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasBrandingLicense": {
                          "type": "boolean"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "totalRequests": {
                              "type": "number"
                            },
                            "totalAccountsClosed": {
                              "type": "number"
                            },
                            "totalSolRecovered": {
                              "type": "number"
                            },
                            "totalFeesEarned": {
                              "type": "number"
                            }
                          }
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "lastUsedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Wallet verified successfully",
                  "sessionToken": "c4e7...f0",
                  "expiresIn": 3600,
                  "apiKey": {
                    "id": 42,
                    "feeWallet": "4Nd1mY...",
                    "feeWalletBalance": 12500000,
                    "allowedDomains": [
                      "example.com",
                      "*.example.com"
                    ],
                    "isActive": true,
                    "hasBrandingLicense": false,
                    "stats": {
                      "totalRequests": 1840,
                      "totalAccountsClosed": 312,
                      "totalSolRecovered": 5.421,
                      "totalFeesEarned": 0.813
                    },
                    "createdAt": "2026-01-04T10:22:11.000Z",
                    "lastUsedAt": "2026-06-13T08:01:55.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "404": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "The wallet address that requested the challenge. Validated via PublicKey."
                  },
                  "signature": {
                    "type": "string",
                    "description": "Base58-encoded ed25519 signature of the challenge `message`, verified with tweetnacl sign.detached.verify against the wallet's public key."
                  }
                },
                "required": [
                  "walletAddress",
                  "signature"
                ]
              }
            }
          }
        }
      }
    },
    "/api/regenerate-key": {
      "post": {
        "summary": "Regenerate API Key",
        "description": "Step 2 (key rotation): verifies the wallet signature against its pending challenge, then issues a brand-new API key for the wallet's existing active key record, invalidating the old key. The new plaintext key is returned exactly once. Rate-limited to 5 attempts/hour/IP.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-regenerate-key",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "apiKey is the new plaintext key, shown only once (DB stores its hash, overwriting the prior api_key_hash on the same row id — preserving stats and settings). The previously issued key stops authenticating immediately.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "apiKey": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "warning": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "apiKey": "stryke_2b9d...77fa",
                  "message": "API key regenerated successfully. Your old key is now invalid. Save this new key securely!",
                  "warning": "Your previous API key has been invalidated. Update all integrations with this new key."
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "401": {
            "description": "Error"
          },
          "404": {
            "description": "Error"
          },
          "429": {
            "description": "Error"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "The owner wallet that requested the challenge. Validated via PublicKey."
                  },
                  "signature": {
                    "type": "string",
                    "description": "Base58-encoded ed25519 signature of the challenge `message`, verified with tweetnacl against the wallet pubkey."
                  }
                },
                "required": [
                  "walletAddress",
                  "signature"
                ]
              }
            }
          }
        }
      }
    },
    "/api/dashboard/{wallet}": {
      "get": {
        "summary": "Get Public Dashboard by Wallet",
        "description": "Returns all API key records (active and inactive) owned by a wallet, with per-key stats and metadata. Public and unauthenticated — no signature or API key required — so it exposes only non-sensitive fields (no plaintext key, no session). Intended for a basic dashboard lookup before login.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "get-api-dashboard-wallet",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The owner's Solana wallet address (base58). Validated via PublicKey; invalid input returns 400."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "When the wallet owns no keys, returns 200 with hasApiKey: false and a message (no apiKeys array). Returns ALL keys for the wallet ordered by created_at DESC, including inactive ones (isActive reflects per-key status). Does not include allowedDomains or any session/key secret. brandingLicenseTx is the on-chain signature once a license is active, else null.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "hasApiKey": {
                      "type": "boolean"
                    },
                    "apiKeys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "feeWallet": {
                            "type": "string"
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "hasBrandingLicense": {
                            "type": "boolean"
                          },
                          "brandingLicenseTx": {},
                          "stats": {
                            "type": "object",
                            "properties": {
                              "totalRequests": {
                                "type": "number"
                              },
                              "totalAccountsClosed": {
                                "type": "number"
                              },
                              "totalSolRecovered": {
                                "type": "number"
                              },
                              "totalFeesEarned": {
                                "type": "number"
                              }
                            }
                          },
                          "email": {
                            "type": "string"
                          },
                          "websiteUrl": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "hasApiKey": true,
                  "apiKeys": [
                    {
                      "id": 42,
                      "feeWallet": "4Nd1mY...",
                      "isActive": true,
                      "hasBrandingLicense": false,
                      "brandingLicenseTx": null,
                      "stats": {
                        "totalRequests": 1840,
                        "totalAccountsClosed": 312,
                        "totalSolRecovered": 5.421,
                        "totalFeesEarned": 0.813
                      },
                      "email": "dev@example.com",
                      "websiteUrl": "https://example.com",
                      "createdAt": "2026-01-04T10:22:11.000Z",
                      "lastUsedAt": "2026-06-13T08:01:55.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        }
      }
    },
    "/api/dashboard-session": {
      "get": {
        "summary": "Get Dashboard via Session Token",
        "description": "Returns the authenticated dashboard for the key tied to a valid wallet-login session token, including key metadata, stats, fee wallet balance, and the 20 most recent recovery transactions. Authenticated by the X-Session-Token header (issued by /api/auth/wallet-login), not by X-API-Key.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "get-api-dashboard-session",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "recentTransactions are the latest 20 rows from sk_api_transactions for this key, newest first. feeWalletBalance is in lamports via the node RPC, null if the lookup fails. allowedDomains is null when unrestricted. This is the session-authenticated counterpart to /api/dashboard/{wallet} and returns richer (private) data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "walletAddress": {
                      "type": "string"
                    },
                    "apiKey": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "feeWallet": {
                          "type": "string"
                        },
                        "feeWalletBalance": {
                          "type": "number"
                        },
                        "allowedDomains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasBrandingLicense": {
                          "type": "boolean"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "totalRequests": {
                              "type": "number"
                            },
                            "totalAccountsClosed": {
                              "type": "number"
                            },
                            "totalSolRecovered": {
                              "type": "number"
                            },
                            "totalFeesEarned": {
                              "type": "number"
                            }
                          }
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "lastUsedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "recentTransactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "walletAddress": {
                            "type": "string"
                          },
                          "accountsClosed": {
                            "type": "number"
                          },
                          "solRecovered": {
                            "type": "number"
                          },
                          "feeEarned": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "walletAddress": "4Nd1mY...",
                  "apiKey": {
                    "id": 42,
                    "feeWallet": "4Nd1mY...",
                    "feeWalletBalance": 12500000,
                    "allowedDomains": [
                      "example.com"
                    ],
                    "isActive": true,
                    "hasBrandingLicense": false,
                    "stats": {
                      "totalRequests": 1840,
                      "totalAccountsClosed": 312,
                      "totalSolRecovered": 5.421,
                      "totalFeesEarned": 0.813
                    },
                    "createdAt": "2026-01-04T10:22:11.000Z",
                    "lastUsedAt": "2026-06-13T08:01:55.000Z"
                  },
                  "recentTransactions": [
                    {
                      "walletAddress": "9xQe...",
                      "accountsClosed": 4,
                      "solRecovered": 0.0082,
                      "feeEarned": 0.00092,
                      "signature": "5h2k...",
                      "createdAt": "2026-06-12T19:44:02.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error"
          },
          "404": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        }
      }
    },
    "/api/update-domains": {
      "post": {
        "summary": "Update Allowed Domains (Session)",
        "description": "Sets the allowed-domain allowlist for the session's API key. Authenticated by the X-Session-Token header. Domains are normalized (trimmed, lowercased) and validated against a hostname regex (supports a leading wildcard like *.example.com); an empty/invalid list clears the restriction so the key works on any domain.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-update-domains",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "allowedDomains echoes the stored, normalized list, or null when restrictions were removed (in which case message is 'Domain restrictions removed'). The value is persisted as a comma-separated string in sk_api_keys.allowed_domains and enforced later by validateApiKey/isDomainAllowed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "allowedDomains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Domains updated: example.com,*.app.example.com",
                  "allowedDomains": [
                    "example.com",
                    "*.app.example.com"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of domain strings to allow (e.g. ['example.com','*.app.example.com']). Each is trimmed, lowercased, and filtered by a hostname regex permitting an optional leading '*.'. If the array is empty, missing, or all entries are invalid, the domain restriction is removed (key allowed on all domains)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/dashboard/update-fee-wallet": {
      "post": {
        "summary": "Update Fee Wallet",
        "description": "Changes the destination (fee) wallet that receives the integrator's share of recovery fees for a specific API key. Authorization is by ownership match: the UPDATE only succeeds when the supplied apiKeyId belongs to ownerWallet. No signature or session token is verified.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-dashboard-update-fee-wallet",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Returns only success + message. The UPDATE is scoped by both id and owner_wallet, so a mismatch returns 404 rather than modifying another owner's key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Fee wallet updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "404": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerWallet": {
                    "type": "string",
                    "description": "The wallet that owns the API key. Validated via PublicKey and matched against the key's owner_wallet in the WHERE clause."
                  },
                  "newFeeWallet": {
                    "type": "string",
                    "description": "The new Solana wallet (base58) to receive fee payouts. Validated via PublicKey."
                  },
                  "apiKeyId": {
                    "type": "number",
                    "description": "The numeric id of the API key to update. Must belong to ownerWallet or the update affects 0 rows (404)."
                  }
                },
                "required": [
                  "ownerWallet",
                  "newFeeWallet",
                  "apiKeyId"
                ]
              }
            }
          }
        }
      }
    },
    "/api/branding-license": {
      "get": {
        "summary": "Get Branding License Info",
        "description": "Returns static information about the white-label branding license: its cost in SOL, the payment recipient wallet, and the list of unlocked features. Public, no parameters, no DB access — purely informational for the purchase flow.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "get-api-branding-license",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "cost is BRANDING_LICENSE_COST (0.5 SOL) and paymentWallet is BRANDING_LICENSE_WALLET — the values to use when constructing the payment that /api/verify-branding-payment will later validate. Fully static; identical on every call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "cost": {
                      "type": "number"
                    },
                    "paymentWallet": {
                      "type": "string"
                    },
                    "features": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "cost": 0.5,
                  "paymentWallet": "REfUndEd1DoYqRzHtjPpx1WYgTL2f2C86pnU44x1jgc",
                  "features": [
                    "Use your own logo in the widget",
                    "Remove \"Powered by Stryke\" branding",
                    "Custom redirect URLs",
                    "White-label experience for your users"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/verify-branding-payment": {
      "post": {
        "summary": "Verify Branding License Payment",
        "description": "Validates an on-chain SOL payment for the branding license and, if valid, activates the white-label license on the specified API key. Confirms the transaction on-chain, checks it is recent (<1 hour), and verifies the license wallet received at least ~0.5 SOL (1% fee tolerance). Authorization is by ownerWallet/apiKeyId ownership match.",
        "tags": [
          "Account & Keys"
        ],
        "operationId": "post-api-verify-branding-payment",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "On success, sets has_branding_license = TRUE and stores the signature in branding_license_tx. If the license was already active, returns 200 with alreadyActive: true and message 'Branding license already active' (no re-verification). Payment is accepted if the license wallet's balance delta >= 0.99 * 0.5 SOL (in lamports).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "features": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Branding license activated! You can now use custom logos and remove \"Powered by Stryke\".",
                  "features": [
                    "Use your own logo in the widget",
                    "Remove \"Powered by Stryke\" branding",
                    "Custom redirect URLs",
                    "White-label experience for your users"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error"
          },
          "404": {
            "description": "Error"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerWallet": {
                    "type": "string",
                    "description": "The wallet that owns the API key. Matched against owner_wallet for the given apiKeyId."
                  },
                  "transactionSignature": {
                    "type": "string",
                    "description": "The Solana transaction signature of the 0.5 SOL payment to the branding license wallet. Fetched on-chain (commitment 'confirmed') and inspected for the payment to BRANDING_LICENSE_WALLET."
                  },
                  "apiKeyId": {
                    "type": "number",
                    "description": "The numeric id of the API key to activate branding on. Must belong to ownerWallet."
                  }
                },
                "required": [
                  "ownerWallet",
                  "transactionSignature",
                  "apiKeyId"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/check": {
      "post": {
        "summary": "Check Wallets for Recoverable Rent",
        "description": "Scans one or more Solana wallets for empty and balance-holding token accounts and returns the estimated SOL rent that could be recovered by closing/burning them, without producing or submitting any transactions.",
        "tags": [
          "Recovery (v1)"
        ],
        "operationId": "post-api-v1-check",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "All SOL amounts are in SOL (lamports / LAMPORTS_PER_SOL), not lamports. `potentialRecovery`/`estimatedReturn`/`fee` are the close-only (empty-account) figures kept for backwards compatibility; `burn*` are the additional recovery from burning non-empty accounts; `total*` is close+burn combined. `canProcess` is true when the wallet has > 5000 lamports (enough for a tx fee) or has no empty accounts. Per-wallet entries that fail validation/fetch are shaped `{address, error: 'Invalid wallet address or fetch error'}` and are excluded from `totals`. `hasBrandingLicense` reflects the calling API key's branding-license flag (used by the SDK to toggle the upgrade banner).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "emptyTokenAccounts": {
                            "type": "number"
                          },
                          "accountsWithBalance": {
                            "type": "number"
                          },
                          "walletBalance": {
                            "type": "number"
                          },
                          "potentialRecovery": {
                            "type": "number"
                          },
                          "estimatedReturn": {
                            "type": "number"
                          },
                          "fee": {
                            "type": "number"
                          },
                          "burnRecovery": {
                            "type": "number"
                          },
                          "burnEstimatedReturn": {
                            "type": "number"
                          },
                          "burnFee": {
                            "type": "number"
                          },
                          "totalRecovery": {
                            "type": "number"
                          },
                          "totalEstimatedReturn": {
                            "type": "number"
                          },
                          "totalFee": {
                            "type": "number"
                          },
                          "canProcess": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "totalEmptyAccounts": {
                          "type": "number"
                        },
                        "totalAccountsWithBalance": {
                          "type": "number"
                        },
                        "totalCloseRecovery": {
                          "type": "number"
                        },
                        "totalCloseReturn": {
                          "type": "number"
                        },
                        "totalBurnRecovery": {
                          "type": "number"
                        },
                        "totalBurnReturn": {
                          "type": "number"
                        },
                        "totalPotentialRecovery": {
                          "type": "number"
                        },
                        "totalEstimatedReturn": {
                          "type": "number"
                        }
                      }
                    },
                    "hasBrandingLicense": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallets": [
                    {
                      "address": "4Nd1mB...x9Qe",
                      "emptyTokenAccounts": 12,
                      "accountsWithBalance": 3,
                      "walletBalance": 0.0421,
                      "potentialRecovery": 0.02446,
                      "estimatedReturn": 0.02201,
                      "fee": 0.00245,
                      "burnRecovery": 0.006116,
                      "burnEstimatedReturn": 0.005504,
                      "burnFee": 0.000612,
                      "totalRecovery": 0.030576,
                      "totalEstimatedReturn": 0.027518,
                      "totalFee": 0.003058,
                      "canProcess": true
                    }
                  ],
                  "totals": {
                    "totalEmptyAccounts": 12,
                    "totalAccountsWithBalance": 3,
                    "totalCloseRecovery": 0.02446,
                    "totalCloseReturn": 0.02201,
                    "totalBurnRecovery": 0.006116,
                    "totalBurnReturn": 0.005504,
                    "totalPotentialRecovery": 0.030576,
                    "totalEstimatedReturn": 0.027518
                  },
                  "hasBrandingLicense": false
                }
              }
            }
          },
          "400": {
            "description": "walletAddresses array required (missing/empty/not an array; Maximum 20 wallets per request"
          },
          "401": {
            "description": "API key required / Invalid or inactive API key"
          },
          "403": {
            "description": "Domain not allowed (key domain restriction"
          },
          "429": {
            "description": "Rate limited (apiLimiter"
          },
          "500": {
            "description": "Failed to check wallets"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddresses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of base58 Solana wallet addresses to scan. Must be a non-empty array with at most 20 entries. Invalid addresses are returned per-wallet with an `error` field rather than failing the whole request."
                  },
                  "includeAccounts": {
                    "type": "boolean",
                    "description": "When true, each wallet result also includes an `accounts` object with `empty` and `burnable` arrays of formatted token-account details (account, mint, displayName, owner, program, decimals, uiAmount, amountRaw, state, isFrozen, type). Defaults to false."
                  }
                },
                "required": [
                  "walletAddresses"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/close": {
      "post": {
        "summary": "Build Close/Burn Transactions",
        "description": "Builds unsigned (base64-serialized) Solana transactions that close empty token accounts (and optionally burn + close balance-holding accounts) to reclaim rent, chunked to fit transaction size limits. The client signs and submits them; nothing is broadcast server-side.",
        "tags": [
          "Recovery (v1)"
        ],
        "operationId": "post-api-v1-close",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "`walletTransactions` is keyed by wallet address; each value is normally an array of `{transaction (base64), accountsInTx, estimatedFee (SOL), usedFeePayer}`. Wallets with no closeable/burnable accounts are skipped (omitted from the map). If a single wallet errors while building, its value becomes `{error: <message>}` instead of an array (the overall response is still 200/success:true). Transactions are serialized with requireAllSignatures:false; when the owner balance is low (< 0.002 SOL) and a fee payer is configured, the transaction is partially signed by the platform fee payer and `usedFeePayer` is true. Fees (platform + owner split) are embedded as SystemProgram.transfer instructions; `summary` figures are in SOL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "walletTransactions": {
                      "type": "object",
                      "properties": {
                        "4Nd1mB...x9Qe": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "transaction": {
                                "type": "string"
                              },
                              "accountsInTx": {
                                "type": "number"
                              },
                              "estimatedFee": {
                                "type": "number"
                              },
                              "usedFeePayer": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "totalAccountsToClose": {
                          "type": "number"
                        },
                        "totalPotentialRecovery": {
                          "type": "number"
                        },
                        "totalFee": {
                          "type": "number"
                        },
                        "platformFee": {
                          "type": "number"
                        },
                        "ownerFee": {
                          "type": "number"
                        },
                        "userReturn": {
                          "type": "number"
                        }
                      }
                    },
                    "instructions": {
                      "type": "object",
                      "properties": {
                        "step1": {
                          "type": "string"
                        },
                        "step2": {
                          "type": "string"
                        },
                        "step3": {
                          "type": "string"
                        },
                        "step4": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Generated transactions for 1 wallets",
                  "walletTransactions": {
                    "4Nd1mB...x9Qe": [
                      {
                        "transaction": "AQAAAAA...base64...",
                        "accountsInTx": 8,
                        "estimatedFee": 0.00163,
                        "usedFeePayer": false
                      }
                    ]
                  },
                  "summary": {
                    "totalAccountsToClose": 8,
                    "totalPotentialRecovery": 0.0163,
                    "totalFee": 0.00163,
                    "platformFee": 0.001141,
                    "ownerFee": 0.000489,
                    "userReturn": 0.01467
                  },
                  "instructions": {
                    "step1": "Decode each transaction from base64",
                    "step2": "Sign with the wallet owner's keypair",
                    "step3": "Submit to Solana network",
                    "step4": "Call /api/v1/confirm to log the transaction"
                  }
                }
              }
            }
          },
          "400": {
            "description": "walletAddresses array required (missing/empty/not an array; Maximum 20 wallets per request"
          },
          "401": {
            "description": "API key required / Invalid or inactive API key"
          },
          "403": {
            "description": "Domain not allowed (key domain restriction"
          },
          "429": {
            "description": "Rate limited (apiLimiter"
          },
          "500": {
            "description": "Failed to generate transactions"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddresses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of base58 wallet addresses (the account owners) to build transactions for. Non-empty, max 20 entries."
                  },
                  "refundWallet": {
                    "type": "string",
                    "description": "Optional base58 address that should receive the reclaimed rent (close-account destination). Defaults to each wallet's own address when omitted."
                  },
                  "burnAccounts": {
                    "type": "boolean",
                    "description": "When true, also burns tokens in non-empty accounts (then closes them) to reclaim their rent. Uses a smaller chunk size and higher compute budget per account. Defaults to false."
                  },
                  "selectedTokens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional whitelist of mint addresses to burn. Only applied when burnAccounts is true; when non-empty, only accounts whose mint is in this set are burned. Defaults to [] (burn all non-empty accounts)."
                  }
                },
                "required": [
                  "walletAddresses"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/confirm": {
      "post": {
        "summary": "Confirm Transaction (Log Stats)",
        "description": "Records a completed close/burn transaction for tracking and per-API-key statistics (accounts closed, SOL recovered, owner fee earned). Does not verify the transaction on-chain.",
        "tags": [
          "Recovery (v1)"
        ],
        "operationId": "post-api-v1-confirm",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success the handler inserts a row into sk_api_transactions and increments sk_api_keys totals (total_accounts_closed, total_sol_recovered, total_fees_earned with the owner-fee share). `stats.accountsClosed`/`solRecovered` echo the request body verbatim; `ownerFeeEarned` is computed as solRecovered * TOTAL_FEE_RATE * (1 - a platform setting). For the builder/preview key (apiKeyData.is_builder_key) the handler short-circuits: it skips all DB writes and returns success with a different message ('Builder preview transaction acknowledged (not persisted)') and stats defaulted to 0 where unset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "accountsClosed": {
                          "type": "number"
                        },
                        "solRecovered": {
                          "type": "number"
                        },
                        "ownerFeeEarned": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Transaction logged successfully",
                  "stats": {
                    "accountsClosed": 8,
                    "solRecovered": 0.0163,
                    "ownerFeeEarned": 0.000489
                  }
                }
              }
            }
          },
          "400": {
            "description": "walletAddress and signature required"
          },
          "401": {
            "description": "API key required / Invalid or inactive API key"
          },
          "403": {
            "description": "Domain not allowed (key domain restriction"
          },
          "429": {
            "description": "Rate limited (apiLimiter"
          },
          "500": {
            "description": "Failed to log transaction"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "The wallet address the transaction was executed for."
                  },
                  "signature": {
                    "type": "string",
                    "description": "The on-chain transaction signature to log (stored as transaction_signature)."
                  },
                  "accountsClosed": {
                    "type": "number",
                    "description": "Number of token accounts closed/burned in the transaction. Defaults to 0 when omitted; added to the key's running total."
                  },
                  "solRecovered": {
                    "type": "number",
                    "description": "SOL reclaimed by the transaction. Defaults to 0; drives the platform-fee / owner-fee split and the key's running totals."
                  }
                },
                "required": [
                  "walletAddress",
                  "signature"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "summary": "Get API Key Stats",
        "description": "Returns lifetime usage statistics for the calling API key plus its 10 most recent logged transactions.",
        "tags": [
          "Recovery (v1)"
        ],
        "operationId": "get-api-v1-stats",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "`stats` is read directly off the authenticated key row (sk_api_keys); totalSolRecovered/totalFeesEarned are parseFloat'd from DECIMAL columns. `recentTransactions` is the 10 newest rows from sk_api_transactions for this key (ordered created_at DESC), mapped to {walletAddress, accountsClosed, solRecovered, feeEarned (= owner_fee), signature, createdAt}. All stats are scoped to the calling key only.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "totalRequests": {
                          "type": "number"
                        },
                        "totalAccountsClosed": {
                          "type": "number"
                        },
                        "totalSolRecovered": {
                          "type": "number"
                        },
                        "totalFeesEarned": {
                          "type": "number"
                        },
                        "feeWallet": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "lastUsedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "recentTransactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "walletAddress": {
                            "type": "string"
                          },
                          "accountsClosed": {
                            "type": "number"
                          },
                          "solRecovered": {
                            "type": "number"
                          },
                          "feeEarned": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "stats": {
                    "totalRequests": 1042,
                    "totalAccountsClosed": 318,
                    "totalSolRecovered": 0.6471,
                    "totalFeesEarned": 0.0194,
                    "feeWallet": "9xQeWv...Hh3",
                    "createdAt": "2026-01-04T11:22:00.000Z",
                    "lastUsedAt": "2026-06-13T09:15:42.000Z"
                  },
                  "recentTransactions": [
                    {
                      "walletAddress": "4Nd1mB...x9Qe",
                      "accountsClosed": 8,
                      "solRecovered": 0.0163,
                      "feeEarned": 0.000489,
                      "signature": "5h2k...Qe",
                      "createdAt": "2026-06-12T18:40:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "API key required / Invalid or inactive API key"
          },
          "403": {
            "description": "Domain not allowed (key domain restriction"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Failed to get stats"
          }
        }
      }
    },
    "/api/token-info": {
      "post": {
        "summary": "Token Metadata (Proxy)",
        "description": "Fetches token metadata for a batch of mint addresses by proxying to the public Stryke.com token-info service. Pass-through endpoint with permissive CORS.",
        "tags": [
          "Recovery (v1)"
        ],
        "operationId": "post-api-token-info",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "This is a thin proxy: it forwards {mints} to https://Stryke.com/api/token-info and relays the upstream response. If the upstream body is valid JSON it is returned with res.status(upstream.status).json(...); if the upstream body is not JSON, the raw text is relayed via res.send(text) with the upstream status. The exact shape is whatever the upstream service returns, so it is not fixed by this handler.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid 'mints' array (not an array or empty"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Unable to fetch token metadata right now (the upstream fetch threw / network failure"
          },
          "4XX": {
            "description": "/5xx — relayed verbatim from the upstream Stryke.com response (status + body passed through"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of base58 token mint addresses to look up metadata for. Must be a non-empty array; otherwise 400."
                  }
                },
                "required": [
                  "mints"
                ]
              }
            }
          }
        }
      }
    },
    "/api/rpc/send": {
      "post": {
        "summary": "Send Transaction (RPC proxy)",
        "description": "Server-side proxy that forwards a signed, base64-encoded transaction to the the node RPC `sendTransaction` method and returns the raw JSON-RPC response. Exists so the paid Stryke's node layer key never leaves the server; defaults skipPreflight=false and preflightCommitment=confirmed, which the caller can override via `options`.",
        "tags": [
          "Direct RPC"
        ],
        "operationId": "post-api-rpc-send",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "The handler passes through the raw Stryke's node layer JSON-RPC envelope verbatim (`res.status(status).json(data)`), so the body is whatever Stryke's node layer returns and the HTTP status is the upstream status (typically 200). On success the envelope has `result` = the transaction signature string. If Stryke's node layer rejects the tx, the same envelope carries an `error` object ({ code, message, data }) instead of `result`, still under the upstream HTTP status. The encoding/commitment defaults are not echoed back; only the JSON-RPC envelope is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "result": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": "6f9619ff-8b86-d011-b42d-00cf4fc964ff",
                  "result": "5V_signature_base58_..."
                }
              }
            }
          },
          "400": {
            "description": "Missing transaction (base64): { \"error\": \"Missing transaction (base64)\" } when req.body.transaction is falsy."
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Upstream fetch threw (network/Stryke's node layer unreachable): { \"error\": \"the node RPC send failed\" }. Note: a node-level JSON-RPC error does NOT produce 502 — it is passed through with the upstream HTTP status (usually 200) as an `error` field in the body."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transaction": {
                    "type": "string",
                    "description": "Base64-encoded, fully-signed serialized transaction. Required — a falsy value returns 400."
                  },
                  "options": {
                    "type": "object",
                    "description": "Optional overrides spread onto the Stryke's node layer sendTransaction config object. Defaults applied before spread: { encoding: 'base64', skipPreflight: false, preflightCommitment: 'confirmed' }. Anything here (e.g. skipPreflight, maxRetries, preflightCommitment) overrides those defaults. Defaults to {}."
                  }
                },
                "required": [
                  "transaction"
                ]
              }
            }
          }
        }
      }
    },
    "/api/rpc/status": {
      "post": {
        "summary": "Get Signature Statuses (RPC proxy)",
        "description": "Server-side proxy to the node RPC `getSignatureStatuses`. Accepts either a single `signature` or an array of `signatures`, normalizes to an array, and returns the raw JSON-RPC response. Defaults searchTransactionHistory=false (overridable via `options`).",
        "tags": [
          "Direct RPC"
        ],
        "operationId": "post-api-rpc-status",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Raw Stryke's node layer JSON-RPC envelope passed through verbatim with the upstream HTTP status (typically 200). `result.value` is an array aligned 1:1 with the input signatures; each element is either a status object ({ slot, confirmations, err, confirmationStatus, status }) or null when the signature is unknown/expired from the recent cache (and searchTransactionHistory was false). On a node-level failure the envelope carries an `error` object instead of `result`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "context": {
                          "type": "object",
                          "properties": {
                            "slot": {
                              "type": "number"
                            }
                          }
                        },
                        "value": {
                          "type": "array",
                          "items": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "slot": {
                                "type": "number"
                              },
                              "confirmations": {
                                "type": "number"
                              },
                              "err": {},
                              "confirmationStatus": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": "6f9619ff-8b86-d011-b42d-00cf4fc964ff",
                  "result": {
                    "context": {
                      "slot": 282934711
                    },
                    "value": [
                      {
                        "slot": 282934700,
                        "confirmations": 10,
                        "err": null,
                        "confirmationStatus": "confirmed"
                      },
                      null
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing signature(s): { \"error\": \"Missing signature(s)\" } when neither `signatures` nor `signature` yields a non-empty array (covers null, non-array, and empty-array inputs)."
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Upstream fetch threw: { \"error\": \"the node RPC status failed\" }. A Stryke's node layer JSON-RPC error is NOT a 502 — it passes through with the upstream HTTP status."
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signatures": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of base58 transaction signatures to look up. Takes precedence over `signature`. Either this or `signature` must be supplied and resolve to a non-empty array, or the request 400s."
                  },
                  "signature": {
                    "type": "string",
                    "description": "A single base58 transaction signature; wrapped into a one-element array if `signatures` is not provided. Either this or `signatures` is required."
                  },
                  "options": {
                    "type": "object",
                    "description": "Optional overrides spread onto the getSignatureStatuses config. Default applied before spread: { searchTransactionHistory: false }. Set { searchTransactionHistory: true } to search older confirmed transactions. Defaults to {}."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/rpc/simulate": {
      "post": {
        "summary": "Simulate Transaction (debug)",
        "description": "Debug endpoint that deserializes a base64 transaction (tries VersionedTransaction, falls back to legacy Transaction) and simulates it against the live connection with sigVerify=false and replaceRecentBlockhash=true. Returns a custom summary of the simulation rather than a raw RPC envelope.",
        "tags": [
          "Direct RPC"
        ],
        "operationId": "post-api-rpc-simulate",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Unlike /send and /status, this returns a custom-shaped 200 body (not the raw JSON-RPC envelope) built from simulation.value: `success` (always true when simulation completes, even if the tx itself errored), `err` (the on-chain simulation error or null), `logs` (full program-log array, [] if none), `unitsConsumed` (compute units), `accountsReturned` (count of returned accounts, 0 if none), and `simulationDetails` { hasError: !!err, computeUnits, logCount }. A transaction that fails on-chain still yields HTTP 200 with success:true and a populated `err` — inspect `err`/`simulationDetails.hasError`, not the HTTP status, to know if the tx would fail.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "err": {},
                    "logs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "unitsConsumed": {
                      "type": "number"
                    },
                    "accountsReturned": {
                      "type": "number"
                    },
                    "simulationDetails": {
                      "type": "object",
                      "properties": {
                        "hasError": {
                          "type": "boolean"
                        },
                        "computeUnits": {
                          "type": "number"
                        },
                        "logCount": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "err": null,
                  "logs": [
                    "Program 11111111111111111111111111111111 invoke [1]",
                    "Program 11111111111111111111111111111111 success"
                  ],
                  "unitsConsumed": 450,
                  "accountsReturned": 0,
                  "simulationDetails": {
                    "hasError": false,
                    "computeUnits": 450,
                    "logCount": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing transaction (base64): { \"error\": \"Missing transaction (base64)\" } when req.body.transaction is falsy.; Failed to parse transaction: { \"error\": \"Failed to parse transaction\", \"details\": <parse error message> } when both VersionedTransaction.deserialize and Transaction.from throw."
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Simulation failed: { \"error\": \"Simulation failed\", \"details\": <message>, \"stack\": <only when NODE_ENV==='development'> } when connection.simulateTransaction throws (RPC-level failure, distinct from a tx-level err).; Simulation error: { \"error\": \"Simulation error\", \"details\": <message> } for any other failure in the outer try (e.g. getConnection() throws)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transaction": {
                    "type": "string",
                    "description": "Base64-encoded serialized transaction (signed or unsigned — signatures are not verified during simulation). Required; falsy returns 400. Parsed as a VersionedTransaction first, then legacy Transaction.from() as fallback."
                  },
                  "options": {
                    "type": "object",
                    "description": "Optional overrides spread onto connection.simulateTransaction config. Defaults applied before spread: { sigVerify: false, replaceRecentBlockhash: true }. Can override these or add fields like { accounts: { addresses: [...] }, commitment }. Defaults to {}."
                  }
                },
                "required": [
                  "transaction"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/health": {
      "get": {
        "summary": "Health check",
        "description": "Liveness probe. Returns ok + the API version + a server timestamp. No API key required. (The root /health alias returns the same.)",
        "tags": [
          "System"
        ],
        "operationId": "get-api-v2-health",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "ok is always true when the service is up. ts is server epoch-ms. Use for monitors/load-balancer health.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "version": {
                      "type": "string"
                    },
                    "ts": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "version": "v2",
                  "ts": 1781450000000
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable"
          }
        }
      }
    },
    "/api/v2/stats": {
      "get": {
        "summary": "Per-key usage stats",
        "description": "Usage dashboard for the calling API key over a time range: total calls, error/failure rates, latency, provider spend, a top-routes breakdown, and a daily series for charts. Scoped to the authenticated key only (reads the caller's own call log). Defaults to 7d.",
        "tags": [
          "System"
        ],
        "operationId": "get-api-v2-stats",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "7d"
            },
            "description": "Window: 24h, 7d, 30d, or 90d. Any other value falls back to 7d."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "range_ms = the resolved window in ms; since = window start (epoch-ms). summary: calls, errors (status>=400), failures (status>=500), error_rate/failure_rate (fractions of calls), avg_ms/max_ms (latency), provider_calls (upstream calls made on your behalf), provider_cost_usd (your attributed upstream spend). byRoute[] (top 30 by calls): {route, calls, errors, avg_ms, cost_usd}. series[] (one row per UTC day, ascending): {ts (day bucket, epoch-ms), calls, failures, cost_usd}. All figures are scoped to the calling key only.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "range_ms": {
                      "type": "number"
                    },
                    "since": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "calls": {
                          "type": "number"
                        },
                        "errors": {
                          "type": "number"
                        },
                        "failures": {
                          "type": "number"
                        },
                        "error_rate": {
                          "type": "number"
                        },
                        "failure_rate": {
                          "type": "number"
                        },
                        "avg_ms": {
                          "type": "number"
                        },
                        "max_ms": {
                          "type": "number"
                        },
                        "provider_calls": {
                          "type": "number"
                        },
                        "provider_cost_usd": {
                          "type": "number"
                        }
                      }
                    },
                    "byRoute": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route": {
                            "type": "string"
                          },
                          "calls": {
                            "type": "number"
                          },
                          "errors": {
                            "type": "number"
                          },
                          "avg_ms": {
                            "type": "number"
                          },
                          "cost_usd": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ts": {
                            "type": "number"
                          },
                          "calls": {
                            "type": "number"
                          },
                          "failures": {
                            "type": "number"
                          },
                          "cost_usd": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "range_ms": 604800000,
                  "since": 1782999900000,
                  "summary": {
                    "calls": 18432,
                    "errors": 211,
                    "failures": 37,
                    "error_rate": 0.01145,
                    "failure_rate": 0.00201,
                    "avg_ms": 142,
                    "max_ms": 5210,
                    "provider_calls": 9051,
                    "provider_cost_usd": 4.821
                  },
                  "byRoute": [
                    {
                      "route": "GET /api/v2/tokens/:mint/intel",
                      "calls": 6120,
                      "errors": 44,
                      "avg_ms": 210,
                      "cost_usd": 2.11
                    },
                    {
                      "route": "GET /api/v2/wallets/:wallet/portfolio",
                      "calls": 3902,
                      "errors": 9,
                      "avg_ms": 168,
                      "cost_usd": 1.34
                    }
                  ],
                  "series": [
                    {
                      "ts": 1782950400000,
                      "calls": 2610,
                      "failures": 4,
                      "cost_usd": 0.71
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "no key context (the key carries no server-side id — e.g. the public preview key cannot read usage) / missing/invalid X-API-Key"
          },
          "429": {
            "description": "rate limit exceeded"
          },
          "500": {
            "description": "{ success:false, error } — stats store unavailable"
          }
        }
      }
    },
    "/v1/trade/buy": {
      "post": {
        "summary": "Buy token",
        "description": "Buy a token with the caller's per-user wallet using the same TradeExecutor as the Telegram bot. Auto-detects DEX (or honors dex/pool_address hints), injects the app's atomic platform fee, and supports SOL or USDC/USDT settlement (pay_with_mint). Two modes: custodial (server signs+sends, returns signature) or client_signs:true (returns an unsigned base64 tx for the caller to sign+broadcast). Idempotent via the Idempotency-Key header.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-buy",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Custodial mode returns the TradeResponse struct: success, signature, amount_received (BUY = tokens received, raw units), amount_spent (BUY = SOL lamports spent), timing (per-stage ms + confirm_method/mev_service/dex_name/landed_slot). simulate adds simulated:true, compute_units, logs[]. client_signs:true instead returns {\"success\":true,\"data\":{\"unsigned_tx_base64\":\"...\",\"recent_blockhash\":\"...\",\"last_valid_block_height\":123}}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "amount_received": {
                      "type": "number"
                    },
                    "amount_spent": {
                      "type": "number"
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "total_ms": {
                          "type": "number"
                        },
                        "pool_fetch_ms": {
                          "type": "number"
                        },
                        "detect_ms": {
                          "type": "number"
                        },
                        "confirm_method": {
                          "type": "string"
                        },
                        "mev_service": {
                          "type": "string"
                        },
                        "dex_name": {
                          "type": "string"
                        },
                        "landed_slot": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "signature": "5xQ...",
                  "amount_received": 123456789,
                  "amount_spent": 1000000,
                  "timing": {
                    "total_ms": 820,
                    "pool_fetch_ms": 40,
                    "detect_ms": 120,
                    "confirm_method": "grpc",
                    "mev_service": "jito",
                    "dex_name": "PumpFun",
                    "landed_slot": 255123456
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_amount (amount_in out of 0.00001–100), bad_wallet (client_signs without wallet), no_active_wallet, bad_nonce, or token_not_found"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope, or fee_routing_forbidden when setting fee_bps/fee_wallet without the fee_routing scope"
          },
          "422": {
            "description": "unsupported_settlement_mint, fee_out_of_range, or no_settlement_route (client_signs, no pool in the requested currency"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "trade_error or no_signer (custodial with no resolved signer"
          },
          "503": {
            "description": "no_trading_resources (executor not wired) or build_tx_failed (client_signs build"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint to buy (base58)."
                  },
                  "amount_in": {
                    "type": "number",
                    "description": "Amount to SPEND — SOL by default, or whole pay_with_mint units (e.g. USDC). Must be 0.00001–100. Aliases: amount_sol, amount."
                  },
                  "dex": {
                    "type": "string",
                    "description": "DEX to trade on (auto-detected if omitted): pumpfun, pumpswap, raydium_cpmm, etc. Alias: dex_type."
                  },
                  "pool_address": {
                    "type": "string",
                    "description": "Specific pool/pair address, skips detection. Alias: pair_address."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps (default 1000 = 10%). Max 100000."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via Jito bundle for MEV protection (default false)."
                  },
                  "tip_lamports": {
                    "type": "integer",
                    "description": "MEV/priority tip in lamports (default 1500000 = 0.0015 SOL)."
                  },
                  "compute_unit_price": {
                    "type": "integer",
                    "description": "Priority fee, micro-lamports per CU (default V1_DEFAULT_CU_PRICE, 500000). Alias: cu_price."
                  },
                  "priority_micro_lamports": {
                    "type": "integer",
                    "description": "Priority fee µL/CU; takes precedence over compute_unit_price. Clamped to V1_MAX_PRIORITY_FEE_LAMPORTS. Aliases: priorityFee, priority_fee."
                  },
                  "pay_with_mint": {
                    "type": "string",
                    "description": "Settlement/input currency mint to pay with (default SOL). Accepts SOL/WSOL/USDC/USDT only; token must be in a pool quoted in that currency. Alias: input_mint."
                  },
                  "client_signs": {
                    "type": "boolean",
                    "description": "If true, return an unsigned base64 tx instead of executing (caller signs + broadcasts). Requires wallet pubkey."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "Trading wallet pubkey (required for client_signs payer). Alias: trading_wallet."
                  },
                  "use_router": {
                    "type": "boolean",
                    "description": "Route swap through the on-chain Stryke Router (default false = direct DEX). Only honored on client_signs builds. Aliases: useRouter, route_via_program."
                  },
                  "mev_tip_lamports": {
                    "type": "integer",
                    "description": "Jito tip (total lamports) baked into a client_signs build; omit → 100000 default, 0 → opt-out. Aliases: mevTipLamports, mevTip, jitoTip."
                  },
                  "mev_tip_bps": {
                    "type": "integer",
                    "description": "Jito tip as bps of quoted trade value (resolved server-side). Overridden by mev_tip_lamports. Alias: mevTipBps."
                  },
                  "fee_bps": {
                    "type": "integer",
                    "description": "Per-trade platform fee bps override — only honored with the fee_routing scope (else 403). Alias: fee_bps_override."
                  },
                  "fee_wallet": {
                    "type": "string",
                    "description": "Override destination wallet for this trade's platform fee — only with fee_routing scope (else 403). Alias: feeWallet."
                  },
                  "nonce_account": {
                    "type": "string",
                    "description": "Durable nonce account pubkey (Turbo Mode); pass with nonce_value."
                  },
                  "nonce_value": {
                    "type": "string",
                    "description": "Current nonce hash (base58); required with nonce_account."
                  },
                  "simulate": {
                    "type": "boolean",
                    "description": "Simulate only — runs full pipeline via simulateTransaction, no on-chain submit (default false)."
                  }
                },
                "required": [
                  "mint",
                  "amount_in"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/trade/sell": {
      "post": {
        "summary": "Sell token",
        "description": "Sell a token from the caller's per-user wallet via the same TradeExecutor as the bot. Sell by percent (default 100) or exact amount_in (base units, converted to a percent of the ATA balance). Injects the app's platform fee (deducted from output), supports SOL or USDC/USDT settlement (receive_mint), and offers custodial or client_signs unsigned-tx modes. Closes/records the position on a 100% sell.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-sell",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Custodial mode returns TradeResponse: amount_received (SELL = SOL lamports received), amount_spent (SELL = token amount sold), timing. client_signs:true returns {\"success\":true,\"data\":{\"unsigned_tx_base64\":\"...\",\"recent_blockhash\":\"...\",\"last_valid_block_height\":123}}. simulate adds simulated/compute_units/logs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "amount_received": {
                      "type": "number"
                    },
                    "amount_spent": {
                      "type": "number"
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "total_ms": {
                          "type": "number"
                        },
                        "pool_fetch_ms": {
                          "type": "number"
                        },
                        "detect_ms": {
                          "type": "number"
                        },
                        "confirm_method": {
                          "type": "string"
                        },
                        "mev_service": {
                          "type": "string"
                        },
                        "dex_name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "signature": "3aB...",
                  "amount_received": 980000000,
                  "amount_spent": 123456789,
                  "timing": {
                    "total_ms": 760,
                    "pool_fetch_ms": 35,
                    "detect_ms": 90,
                    "confirm_method": "grpc",
                    "mev_service": "jito",
                    "dex_name": "PumpSwap"
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_amount (amount_in=0), bad_mint, no_tokens (nothing to sell), bad_percent (not 1–100), zero_amount (resolved sell amount 0), bad_wallet, no_active_wallet, bad_nonce, or token_not_found"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope, or fee_routing_forbidden when overriding fee_bps/fee_wallet"
          },
          "422": {
            "description": "unsupported_settlement_mint, fee_out_of_range, or no_settlement_route (client_signs"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "trade_error, no_signer, or balance_error"
          },
          "503": {
            "description": "no_trading_resources or build_tx_failed (client_signs build"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint to sell (base58)."
                  },
                  "percent": {
                    "type": "integer",
                    "description": "Percent of balance to sell, 1–100 (default 100 when amount_in omitted)."
                  },
                  "amount_in": {
                    "type": "integer",
                    "description": "Exact token amount (base units) to sell; converted to a percent of the ATA balance. Alias: amount_tokens."
                  },
                  "dex": {
                    "type": "string",
                    "description": "DEX to trade on (auto-detected if omitted). Alias: dex_type."
                  },
                  "pool_address": {
                    "type": "string",
                    "description": "Specific pool/pair address, skips detection. Alias: pair_address."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps (default 1000). Max 100000."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via Jito bundle (default false)."
                  },
                  "close_token_account": {
                    "type": "boolean",
                    "description": "Close the token ATA after a full sell to reclaim rent. Alias: close_ata."
                  },
                  "tip_lamports": {
                    "type": "integer",
                    "description": "MEV/priority tip in lamports (default 1500000)."
                  },
                  "compute_unit_price": {
                    "type": "integer",
                    "description": "Priority fee µL/CU (default 500000). Alias: cu_price."
                  },
                  "priority_micro_lamports": {
                    "type": "integer",
                    "description": "Priority fee µL/CU; precedence over compute_unit_price; clamped. Aliases: priorityFee, priority_fee."
                  },
                  "receive_mint": {
                    "type": "string",
                    "description": "Currency to RECEIVE (default SOL); accepts SOL/WSOL/USDC/USDT; token must be in a pool quoted in it. Alias: output_mint."
                  },
                  "client_signs": {
                    "type": "boolean",
                    "description": "If true, return an unsigned base64 tx instead of executing."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "Trading wallet pubkey (client_signs payer). Alias: trading_wallet."
                  },
                  "use_router": {
                    "type": "boolean",
                    "description": "Route through the on-chain Stryke Router (default false = direct DEX). client_signs only. Aliases: useRouter, route_via_program."
                  },
                  "mev_tip_lamports": {
                    "type": "integer",
                    "description": "Jito tip (total lamports) for a client_signs build; omit → 100000, 0 → opt-out. Aliases: mevTipLamports, mevTip, jitoTip."
                  },
                  "mev_tip_bps": {
                    "type": "integer",
                    "description": "Jito tip as bps of estimated SOL proceeds (resolved server-side). Overridden by mev_tip_lamports. Alias: mevTipBps."
                  },
                  "fee_bps": {
                    "type": "integer",
                    "description": "Per-trade platform fee bps override — fee_routing scope only (else 403). Alias: fee_bps_override."
                  },
                  "fee_wallet": {
                    "type": "string",
                    "description": "Override platform-fee destination — fee_routing scope only (else 403). Alias: feeWallet."
                  },
                  "nonce_account": {
                    "type": "string",
                    "description": "Durable nonce account pubkey (Turbo Mode)."
                  },
                  "nonce_value": {
                    "type": "string",
                    "description": "Current nonce hash; required with nonce_account."
                  },
                  "simulate": {
                    "type": "boolean",
                    "description": "Simulate only, no on-chain submit (default false)."
                  }
                },
                "required": [
                  "mint"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/trade/buy-multi-hop": {
      "post": {
        "summary": "Buy token (multi-hop alias)",
        "description": "Convenience alias that delegates to /v1/trade/buy with SOL settlement (the executor handles SOL↔USDC bridging automatically). Accepts a slim multi-hop body; bridge_slippage_bps and intermediate_mint are accepted but ignored (routing is automatic).",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-buy-multi-hop",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Identical response shape to /v1/trade/buy (custodial TradeResponse). Tip/cu_price default; nonce and simulate are forced off by the alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "amount_received": {
                      "type": "number"
                    },
                    "amount_spent": {
                      "type": "number"
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "total_ms": {
                          "type": "number"
                        },
                        "pool_fetch_ms": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "signature": "5xQ...",
                  "amount_received": 123456789,
                  "amount_spent": 1000000,
                  "timing": {
                    "total_ms": 900,
                    "pool_fetch_ms": 50
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_amount, no_active_wallet, or token_not_found"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "trade_error"
          },
          "503": {
            "description": "no_trading_resources"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint to buy."
                  },
                  "amount_sol": {
                    "type": "number",
                    "description": "SOL to spend."
                  },
                  "dex_type": {
                    "type": "string",
                    "description": "Optional DEX hint."
                  },
                  "pair_address": {
                    "type": "string",
                    "description": "Optional pool/pair address hint."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps (default 1000)."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via Jito bundle (default false)."
                  },
                  "bridge_slippage_bps": {
                    "type": "integer",
                    "description": "Accepted but ignored — multi-hop routing/bridging is automatic."
                  },
                  "intermediate_mint": {
                    "type": "string",
                    "description": "Accepted but ignored — bridge currency is chosen automatically."
                  }
                },
                "required": [
                  "mint",
                  "amount_sol"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/trade/sell-multi-hop": {
      "post": {
        "summary": "Sell token (multi-hop alias)",
        "description": "Convenience alias that delegates to /v1/trade/sell with SOL settlement (the executor handles SOL↔USDC bridging automatically). bridge_slippage_bps and intermediate_mint are accepted but ignored.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-sell-multi-hop",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Identical response shape to /v1/trade/sell (custodial TradeResponse). Tip/cu_price default; nonce and simulate forced off by the alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "amount_received": {
                      "type": "number"
                    },
                    "amount_spent": {
                      "type": "number"
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "total_ms": {
                          "type": "number"
                        },
                        "pool_fetch_ms": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "signature": "3aB...",
                  "amount_received": 980000000,
                  "amount_spent": 123456789,
                  "timing": {
                    "total_ms": 850,
                    "pool_fetch_ms": 45
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_mint, no_tokens, bad_percent, no_active_wallet, or token_not_found"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "trade_error or balance_error"
          },
          "503": {
            "description": "no_trading_resources"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint to sell."
                  },
                  "percent": {
                    "type": "integer",
                    "description": "Percent of balance to sell, 1–100 (default 100)."
                  },
                  "amount_tokens": {
                    "type": "integer",
                    "description": "Exact token amount (base units) to sell."
                  },
                  "dex_type": {
                    "type": "string",
                    "description": "Optional DEX hint."
                  },
                  "pair_address": {
                    "type": "string",
                    "description": "Optional pool/pair address hint."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps (default 1000)."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via Jito bundle (default false)."
                  },
                  "close_ata": {
                    "type": "boolean",
                    "description": "Close the token ATA after a full sell."
                  },
                  "bridge_slippage_bps": {
                    "type": "integer",
                    "description": "Accepted but ignored — routing/bridging is automatic."
                  },
                  "intermediate_mint": {
                    "type": "string",
                    "description": "Accepted but ignored — bridge currency is chosen automatically."
                  }
                },
                "required": [
                  "mint"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/trade/pool-params": {
      "get": {
        "summary": "Pool params",
        "description": "Resolve and return the on-chain pool parameters for a mint (DEX type, quote mint, SOL-quoted flag) using the executor's cached pool-param fetch. Useful for verifying routing before a trade. Read-only, no wallet needed.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-pool-params",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          },
          {
            "name": "dex_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional DEX hint to skip detection."
          },
          {
            "name": "pair_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional pool/pair address hint."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "is_sol_quoted: whether the pool is quoted in SOL/WSOL. quote_mint: the pool's quote currency mint (null if none). cache_hit: pool-params cache hit. fetch_ms/detect_ms: timings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "dex_type": {
                      "type": "string"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "is_sol_quoted": {
                      "type": "boolean"
                    },
                    "quote_mint": {
                      "type": "string"
                    },
                    "fetch_ms": {
                      "type": "number"
                    },
                    "detect_ms": {
                      "type": "number"
                    },
                    "cache_hit": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "dex_type": "PumpFun",
                  "mint": "So1...",
                  "is_sol_quoted": true,
                  "quote_mint": "So11111111111111111111111111111111111111112",
                  "fetch_ms": 42,
                  "detect_ms": 110,
                  "cache_hit": false
                }
              }
            }
          },
          "400": {
            "description": "token not found / unresolvable, or invalid mint address"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources or pool params fetch failed"
          }
        }
      }
    },
    "/v1/trade/estimate": {
      "get": {
        "summary": "Estimate output",
        "description": "Estimate the output and price impact for a buy or sell of a given amount, using live (best-effort on-chain refreshed) reserves from the resolved pool. Same path as /v1/trade/quote's underlying estimate but with simple query params and no fee accounting.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-estimate",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Input amount in raw base units (lamports for a SOL buy, token base units for a sell)."
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "buy or sell (default buy)."
          },
          {
            "name": "dex_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional DEX hint."
          },
          {
            "name": "pair_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional pool/pair address hint."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "estimated_output: estimated tokens (buy) or SOL/quote lamports (sell) for the given amount. price_impact_pct: estimated price impact percent. Reflects fresh reserves written back to cache so a subsequent build matches.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "dex_type": {
                      "type": "string"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "is_sol_quoted": {
                      "type": "boolean"
                    },
                    "quote_mint": {
                      "type": "string"
                    },
                    "side": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "estimated_output": {
                      "type": "number"
                    },
                    "price_impact_pct": {
                      "type": "number"
                    },
                    "fetch_ms": {
                      "type": "number"
                    },
                    "detect_ms": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "dex_type": "PumpFun",
                  "mint": "So1...",
                  "is_sol_quoted": true,
                  "quote_mint": "So111...112",
                  "side": "buy",
                  "amount": 1000000,
                  "estimated_output": 123456789,
                  "price_impact_pct": 0.42,
                  "fetch_ms": 48,
                  "detect_ms": 105
                }
              }
            }
          },
          "400": {
            "description": "token not found / unresolvable, or invalid mint address"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources or pool params fetch failed"
          }
        }
      }
    },
    "/v1/trade/quote": {
      "post": {
        "summary": "Trade quote",
        "description": "Pre-trade preview WITHOUT building a transaction. One side of input_mint/output_mint must be a quote currency (SOL/WSOL/USDC/USDT), the other the token; buy = spend quote→receive token, sell = sell token→receive quote. Returns gross + net (after platform fee) outputs, the slippage floor the built tx will enforce, price impact, and the route/DEX. Rejects token↔token and cross-currency mismatches.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-quote",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "out_amount = gross swap output; min_out_amount = slippage floor the built tx encodes. net_out_amount/min_net_out_amount account for the platform fee (BUY net==gross tokens, fee is extra cost; SELL net = gross − fee). platform_fee is in the quote currency. price_impact_bps, route, and token block included.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "side": {
                      "type": "string"
                    },
                    "input_mint": {
                      "type": "string"
                    },
                    "in_amount": {
                      "type": "number"
                    },
                    "in_decimals": {
                      "type": "number"
                    },
                    "out_mint": {
                      "type": "string"
                    },
                    "out_amount": {
                      "type": "number"
                    },
                    "out_decimals": {
                      "type": "number"
                    },
                    "min_out_amount": {
                      "type": "number"
                    },
                    "net_out_amount": {
                      "type": "number"
                    },
                    "min_net_out_amount": {
                      "type": "number"
                    },
                    "platform_fee": {
                      "type": "number"
                    },
                    "fee_bps": {
                      "type": "number"
                    },
                    "price_impact_bps": {
                      "type": "number"
                    },
                    "slippage_bps": {
                      "type": "number"
                    },
                    "token": {
                      "type": "object",
                      "properties": {
                        "symbol": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "decimals": {
                          "type": "number"
                        },
                        "price_sol": {
                          "type": "number"
                        },
                        "price_usd": {
                          "type": "number"
                        },
                        "liquidity": {
                          "type": "number"
                        }
                      }
                    },
                    "route": {
                      "type": "object",
                      "properties": {
                        "dex": {
                          "type": "string"
                        },
                        "pair_address": {
                          "type": "string"
                        },
                        "quote_mint": {
                          "type": "string"
                        },
                        "is_sol_quoted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "fetch_ms": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "side": "buy",
                  "input_mint": "So111...112",
                  "in_amount": 1000000,
                  "in_decimals": 9,
                  "out_mint": "Tok...",
                  "out_amount": 123456789,
                  "out_decimals": 6,
                  "min_out_amount": 111111110,
                  "net_out_amount": 123456789,
                  "min_net_out_amount": 111111110,
                  "platform_fee": 10000,
                  "fee_bps": 100,
                  "price_impact_bps": 42,
                  "slippage_bps": 1000,
                  "token": {
                    "symbol": "TOK",
                    "name": "Token",
                    "decimals": 6,
                    "price_sol": 0.0000012,
                    "price_usd": 0.00021,
                    "liquidity": 54000
                  },
                  "route": {
                    "dex": "PumpFun",
                    "pair_address": "Pa1r...",
                    "quote_mint": "So111...112",
                    "is_sol_quoted": true
                  },
                  "fetch_ms": 50
                }
              }
            }
          },
          "400": {
            "description": "amount=0, both sides quote currencies, token↔token quote unsupported, or invalid token mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "422": {
            "description": "could not estimate output (illiquid pool / amount too small), or cross-currency quote (pool quoted in a different currency than specified"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources or pool params fetch failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input_mint": {
                    "type": "string",
                    "description": "Mint being spent (base58). For a buy this is the quote currency; for a sell it is the token."
                  },
                  "output_mint": {
                    "type": "string",
                    "description": "Mint being received (base58). For a buy this is the token; for a sell it is the quote currency."
                  },
                  "amount": {
                    "type": "integer",
                    "description": "Amount of input_mint in raw base units."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps (default 1000), used to compute min_out_amount."
                  },
                  "dex_type": {
                    "type": "string",
                    "description": "Optional DEX hint to skip detection."
                  },
                  "pair_address": {
                    "type": "string",
                    "description": "Optional pool/pair address hint."
                  }
                },
                "required": [
                  "input_mint",
                  "output_mint",
                  "amount"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/trade/bundle-status": {
      "get": {
        "summary": "Bundle / landing status",
        "description": "Report the ACTUAL landing of an MEV broadcast so a client can honestly badge 'MEV protected' only when the Jito bundle itself landed. Pass bundle_id (from the broadcast response) for Jito getBundleStatuses attribution and/or signature for definitive on-chain landing (incl. the RPC-fallback leg). At least one is required.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-bundle-status",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bundle id from the broadcast response (Jito attribution). Preferred for MEV badging."
          },
          {
            "name": "signature",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Tx signature for definitive on-chain landing (catches the RPC-fallback leg)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "landed: tx on-chain via either leg. mev_protected: true ONLY when the Jito bundle itself landed (not the public-RPC fallback). bundle_status ∈ landed/failed/pending/unknown; onchain_status ∈ landed/failed/pending/unavailable. Keys appear only for the inputs provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "bundle_id": {
                      "type": "string"
                    },
                    "bundle_status": {
                      "type": "string"
                    },
                    "bundle_landed_slot": {
                      "type": "number"
                    },
                    "bundle_confirmation": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "onchain_status": {
                      "type": "string"
                    },
                    "onchain_slot": {
                      "type": "number"
                    },
                    "onchain_confirmation": {
                      "type": "string"
                    },
                    "landed": {
                      "type": "boolean"
                    },
                    "mev_protected": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "bundle_id": "abc",
                  "bundle_status": "landed",
                  "bundle_landed_slot": 255123456,
                  "bundle_confirmation": "confirmed",
                  "signature": "3aB...",
                  "onchain_status": "landed",
                  "onchain_slot": 255123456,
                  "onchain_confirmation": "confirmed",
                  "landed": true,
                  "mev_protected": true
                }
              }
            }
          },
          "400": {
            "description": "neither bundle_id nor signature provided"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/trade/balance": {
      "get": {
        "summary": "Token balance",
        "description": "Return the token balance for the requesting user's wallet, split across the seed-derived and standard ATAs. Resolves the per-user wallet from the authenticated session/X-User-Ref.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-balance",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "total_balance = seed + standard; the two ATA balances are broken out (raw base units).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "total_balance": {
                      "type": "number"
                    },
                    "seed_ata_balance": {
                      "type": "number"
                    },
                    "standard_ata_balance": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "Wa11et...",
                  "mint": "Tok...",
                  "total_balance": 123456789,
                  "seed_ata_balance": 123456789,
                  "standard_ata_balance": 0
                }
              }
            }
          },
          "400": {
            "description": "no_active_wallet or invalid mint address"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources or balance fetch failed"
          }
        }
      }
    },
    "/v1/trade/sol-balance": {
      "get": {
        "summary": "SOL balance",
        "description": "Return the SOL balance (lamports + SOL) for the requesting user's wallet, resolved from the authenticated session/X-User-Ref. No params.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-sol-balance",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "balance_lamports raw; balance_sol = lamports / 1e9.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "balance_lamports": {
                      "type": "number"
                    },
                    "balance_sol": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "Wa11et...",
                  "balance_lamports": 2500000000,
                  "balance_sol": 2.5
                }
              }
            }
          },
          "400": {
            "description": "no_active_wallet"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources or failed to get SOL balance"
          }
        }
      }
    },
    "/v1/trade/detect": {
      "get": {
        "summary": "Detect DEX",
        "description": "Auto-detect the DEX/pool for a mint without executing a trade, using the same token-info path the bot uses when a user pastes an address (the DEX index + indexer). Returns DEX type, pair address, and basic name/symbol.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-detect",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data_source = where the info came from (indexer/the DEX index/etc.). detect_ms = detection latency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "dex_type": {
                      "type": "string"
                    },
                    "dex_name": {
                      "type": "string"
                    },
                    "pair_address": {
                      "type": "string"
                    },
                    "data_source": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "detect_ms": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "Tok...",
                  "dex_type": "PumpFun",
                  "dex_name": "PumpFun",
                  "pair_address": "Pa1r...",
                  "data_source": "indexer",
                  "name": "Token",
                  "symbol": "TOK",
                  "detect_ms": 118
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "404": {
            "description": "token not found on any supported DEX, or pool drained/$0 liquidity"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources"
          }
        }
      }
    },
    "/v1/trade/broadcast": {
      "post": {
        "summary": "Broadcast signed tx",
        "description": "Relay a client-signed base64 VersionedTransaction to the network through the executor's SWQOS-aware submit pipeline (same endpoints/pool as custodial trades). Auto-detects an embedded Jito tip and offers the tx via sendBundle first (with public-RPC fallback). submitted_via reflects the attempted strategy, NOT a landing guarantee — poll /v1/trade/bundle-status.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "trade-broadcast",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "submitted_via: jito_bundle (tip detected) | swqos (no tip) | fallback_rpc (no executor wired). bundle_id returned for bundle attribution; rpc_fallback true when a public fallback leg exists; landing is always 'pending' at broadcast time.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "signature": {
                          "type": "string"
                        },
                        "submitted_via": {
                          "type": "string"
                        },
                        "bundle_id": {
                          "type": "string"
                        },
                        "rpc_fallback": {
                          "type": "boolean"
                        },
                        "landing": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "signature": "3aB...",
                    "submitted_via": "jito_bundle",
                    "bundle_id": "abc",
                    "rpc_fallback": true,
                    "landing": "pending"
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_base64, or bad_tx (exceeds 2 KiB / undecodable VersionedTransaction"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "submit_failed (executor) or rpc (fallback send"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signed_tx_base64": {
                    "type": "string",
                    "description": "Base64-encoded signed VersionedTransaction (max 2 KiB on the wire)."
                  },
                  "tip_lamports": {
                    "type": "integer",
                    "description": "Informational only — tip already embedded in the signed tx; the submit path adds no tip instructions."
                  }
                },
                "required": [
                  "signed_tx_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/token/info": {
      "get": {
        "summary": "Token info",
        "description": "Full token info (price, market cap, liquidity, 24h volume, DEX/pair, bonding-curve and authority flags) using the same fetch path the bot uses when a user pastes an address. No wallet needed.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "token-info",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Includes price_usd/price_sol, market_cap, liquidity, volume_24h, DEX info, plus is_bonding_curve/bonding_curve_percent/is_renounced/is_freezable risk flags.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "price_sol": {
                      "type": "number"
                    },
                    "market_cap": {
                      "type": "number"
                    },
                    "liquidity": {
                      "type": "number"
                    },
                    "volume_24h": {
                      "type": "number"
                    },
                    "dex_type": {
                      "type": "string"
                    },
                    "dex_name": {
                      "type": "string"
                    },
                    "pair_address": {
                      "type": "string"
                    },
                    "data_source": {
                      "type": "string"
                    },
                    "is_bonding_curve": {
                      "type": "boolean"
                    },
                    "bonding_curve_percent": {
                      "type": "number"
                    },
                    "is_renounced": {
                      "type": "boolean"
                    },
                    "is_freezable": {
                      "type": "boolean"
                    },
                    "fetch_ms": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "Tok...",
                  "name": "Token",
                  "symbol": "TOK",
                  "price_usd": 0.00021,
                  "price_sol": 0.0000012,
                  "market_cap": 210000,
                  "liquidity": 54000,
                  "volume_24h": 120000,
                  "dex_type": "PumpFun",
                  "dex_name": "PumpFun",
                  "pair_address": "Pa1r...",
                  "data_source": "indexer",
                  "is_bonding_curve": true,
                  "bonding_curve_percent": 42.5,
                  "is_renounced": true,
                  "is_freezable": false,
                  "fetch_ms": 95
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "404": {
            "description": "token not found on any supported DEX, or pool drained/$0 liquidity"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources"
          }
        }
      }
    },
    "/v1/test/discover": {
      "get": {
        "summary": "Discover pools on-chain",
        "description": "Diagnostic: directly run on-chain pool discovery for a mint (PDA batch + GPA scan), bypassing the indexer DB. Returns every pool found with its DEX, quote mint, and program id, plus discovery latency. Intended for routing/debugging.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "test-discover",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint (base58)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "pools[] each has pool_address, dex_type, quote_mint, program_id. pools_found = count; discover_ms = on-chain discovery latency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "discover_ms": {
                      "type": "number"
                    },
                    "pools_found": {
                      "type": "number"
                    },
                    "pools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pool_address": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "quote_mint": {
                            "type": "string"
                          },
                          "program_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "Tok...",
                  "discover_ms": 210,
                  "pools_found": 2,
                  "pools": [
                    {
                      "pool_address": "Pa1r...",
                      "dex_type": "PumpSwap",
                      "quote_mint": "So111...112",
                      "program_id": "pAMM..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid mint"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "missing trade scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "no_trading_resources"
          }
        }
      }
    },
    "/v1/refund/scan": {
      "get": {
        "summary": "Scan wallet for reclaimable rent",
        "description": "Scans the caller's per-user active wallet for empty token accounts (ATAs) and dust-balance accounts, reporting the SOL rent reclaimable from each. Read-only (no on-chain tx); resolves the wallet from the tenant's X-User-Ref context.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "refund-scan",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "empty_accounts = zero-balance ATAs closeable immediately; dust_accounts = non-zero token balances that need burn-then-close. *_rent_sol are human-formatted strings; total_reclaimable_lamports is the raw u64. token_program distinguishes SPL Token vs Token-2022.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "empty_accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pubkey": {
                            "type": "string"
                          },
                          "mint": {
                            "type": "string"
                          },
                          "rent_lamports": {
                            "type": "number"
                          },
                          "rent_sol": {
                            "type": "string"
                          },
                          "token_program": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "empty_count": {
                      "type": "number"
                    },
                    "dust_accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pubkey": {
                            "type": "string"
                          },
                          "mint": {
                            "type": "string"
                          },
                          "balance": {
                            "type": "number"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "rent_lamports": {
                            "type": "number"
                          },
                          "rent_sol": {
                            "type": "string"
                          },
                          "token_program": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "dust_count": {
                      "type": "number"
                    },
                    "total_accounts": {
                      "type": "number"
                    },
                    "empty_rent_sol": {
                      "type": "string"
                    },
                    "dust_rent_sol": {
                      "type": "string"
                    },
                    "total_reclaimable_sol": {
                      "type": "string"
                    },
                    "total_reclaimable_lamports": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "7xKf...",
                  "empty_accounts": [
                    {
                      "pubkey": "...",
                      "mint": "...",
                      "rent_lamports": 2039280,
                      "rent_sol": "0.00203928",
                      "token_program": "..."
                    }
                  ],
                  "empty_count": 1,
                  "dust_accounts": [
                    {
                      "pubkey": "...",
                      "mint": "...",
                      "balance": 1234,
                      "decimals": 6,
                      "rent_lamports": 2039280,
                      "rent_sol": "0.00203928",
                      "token_program": "..."
                    }
                  ],
                  "dust_count": 1,
                  "total_accounts": 2,
                  "empty_rent_sol": "0.00203928",
                  "dust_rent_sol": "0.00203928",
                  "total_reclaimable_sol": "0.00407856",
                  "total_reclaimable_lamports": 4078560
                }
              }
            }
          },
          "400": {
            "description": "no active wallet for the tenant (error.code = no_active_wallet"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "trading executor not wired in this deployment mode (error.code = no_trading_resources), or RPC scan failed"
          }
        }
      }
    },
    "/v1/refund/close-empty": {
      "post": {
        "summary": "Close empty token accounts",
        "description": "Scans then closes all empty (zero-balance) token accounts for the caller's wallet in a single batch on-chain transaction, reclaiming their SOL rent. Idempotency-key supported (trade-scope idempotency layer). Frozen (honeypot) accounts are skipped and reported.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "refund-close-empty",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success = true when closed>0 OR (no failures and no frozen). closed/failed/frozen are counts; reclaimed_lamports/_sol is rent recovered; signature is the close tx (null if none sent). If frozen>0, error explains the account is FROZEN (honeypot). When nothing to close, returns {success:true,message:\"No empty token accounts found\",closed:0,reclaimed_sol:\"0\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "closed": {
                      "type": "number"
                    },
                    "failed": {
                      "type": "number"
                    },
                    "frozen": {
                      "type": "number"
                    },
                    "reclaimed_lamports": {
                      "type": "number"
                    },
                    "reclaimed_sol": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "total_empty_found": {
                      "type": "number"
                    },
                    "error": {}
                  }
                },
                "example": {
                  "success": true,
                  "closed": 3,
                  "failed": 0,
                  "frozen": 0,
                  "reclaimed_lamports": 6117840,
                  "reclaimed_sol": "0.0061178",
                  "signature": "5xQ...",
                  "total_empty_found": 3,
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "no active wallet for the tenant (error.code = no_active_wallet"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "trading resources not available (no_trading_resources), scan failed, or close tx failed"
          }
        }
      }
    },
    "/v1/refund/burn-and-close": {
      "post": {
        "summary": "Burn dust and close accounts",
        "description": "Scans for token accounts holding dust balances, burns the remaining tokens, and closes the accounts to reclaim SOL rent — in one on-chain batch. Optional max_accounts caps how many are processed this call. Frozen accounts are skipped and reported.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "refund-burn-and-close",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success = true when closed>0 OR (no failures and no frozen). total_dust_found = number of dust accounts attempted (after max_accounts cap). signature is the burn+close tx (null if none). If frozen>0, error notes the account is FROZEN (honeypot). When no dust found, returns {success:true,message:\"No dust token accounts found\",closed:0,reclaimed_sol:\"0\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "closed": {
                      "type": "number"
                    },
                    "failed": {
                      "type": "number"
                    },
                    "frozen": {
                      "type": "number"
                    },
                    "reclaimed_lamports": {
                      "type": "number"
                    },
                    "reclaimed_sol": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "total_dust_found": {
                      "type": "number"
                    },
                    "error": {}
                  }
                },
                "example": {
                  "success": true,
                  "closed": 2,
                  "failed": 0,
                  "frozen": 0,
                  "reclaimed_lamports": 4078560,
                  "reclaimed_sol": "0.00407856",
                  "signature": "3aB...",
                  "total_dust_found": 2,
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "no active wallet for the tenant (no_active_wallet"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "422": {
            "description": "malformed JSON body (Apijson error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "trading resources not available (no_trading_resources), scan failed, or burn+close tx failed"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "max_accounts": {
                    "type": "integer",
                    "description": "Maximum number of dust accounts to burn+close in this call. Defaults to all if omitted."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/refund/close-nonce": {
      "post": {
        "summary": "Close nonce accounts",
        "description": "Closes durable-nonce accounts for the caller's wallet and reclaims their rent. Pass specific nonce_pubkeys to close those, or omit/empty to close ALL nonce (pro) accounts looked up from the DB for this wallet. Closes in one on-chain batch.",
        "tags": [
          "Trading API: Trade & Execution"
        ],
        "operationId": "refund-close-nonce",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "closed/failed are counts; reclaimed_lamports/_sol is rent recovered; signature is the batch close tx (null if none); total_nonce_accounts is how many were targeted. When there are no nonce accounts to close, returns {success:true,message:\"No nonce accounts to close\",closed:0,reclaimed_sol:\"0\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "closed": {
                      "type": "number"
                    },
                    "failed": {
                      "type": "number"
                    },
                    "reclaimed_lamports": {
                      "type": "number"
                    },
                    "reclaimed_sol": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "total_nonce_accounts": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "closed": 4,
                  "failed": 0,
                  "reclaimed_lamports": 5760000,
                  "reclaimed_sol": "0.00576",
                  "signature": "9zC...",
                  "total_nonce_accounts": 4
                }
              }
            }
          },
          "400": {
            "description": "invalid pubkey in nonce_pubkeys, or no active wallet (no_active_wallet"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "wallet not found in DB (when resolving all nonce accounts"
          },
          "422": {
            "description": "malformed JSON body (ApiJson error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "DB error listing nonce accounts, or invalid nonce pubkey stored in DB"
          },
          "503": {
            "description": "trading resources not available (no_trading_resources), or close-nonce tx failed"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nonce_pubkeys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Specific nonce account pubkeys to close. If omitted or empty, closes ALL nonce accounts for this wallet (resolved from DB pro_accounts)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/wallet/list": {
      "get": {
        "summary": "List wallets",
        "description": "Lists all wallets owned by the requesting tenant user (resolved from X-User-Ref). Returns each wallet's id, name, public key, active flag, generated flag, and migration timestamp.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is an array of wallet objects. is_generated=true means the keypair was created by the API (not imported). migrated_at is an RFC3339 string or null. Wallets are scoped to the caller's tenant user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "public_key": {
                            "type": "string"
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "is_generated": {
                            "type": "boolean"
                          },
                          "migrated_at": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 12,
                      "name": "Wallet",
                      "public_key": "7xK… ",
                      "is_active": true,
                      "is_generated": true,
                      "migrated_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        }
      }
    },
    "/v1/wallet/create": {
      "post": {
        "summary": "Create wallet",
        "description": "Generates a brand-new Solana keypair server-side, stores it encrypted, and associates it with the tenant user. Optionally makes it the active wallet.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.id is the new wallet row id; public_key is the generated address. The private key is never returned. Supports Idempotency-Key header to dedupe retries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "public_key": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 13,
                    "name": "Wallet",
                    "public_key": "7xKXtg2CW…"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "409": {
            "description": "duplicate wallet — a wallet with this public key already exists (error.code=duplicate_wallet"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name for the wallet. Defaults to \"Wallet\" if omitted."
                  },
                  "set_active": {
                    "type": "boolean",
                    "description": "If true, marks the new wallet as the user's active wallet. Defaults to false."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/wallet/import": {
      "post": {
        "summary": "Import wallet",
        "description": "Imports an existing wallet from a base58-encoded 64-byte secret key, stores it encrypted, and associates it with the tenant user. Key is validated without panicking; malformed keys are rejected.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-import",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.id is the new wallet row id; public_key is derived from the imported key. The secret is never echoed back.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "public_key": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 14,
                    "name": "Imported Wallet",
                    "public_key": "9aBc…"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid base58 private key / not a valid 64-byte secret key (error.code=bad_private_key"
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "409": {
            "description": "duplicate wallet — public key already exists (error.code=duplicate_wallet"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "private_key": {
                    "type": "string",
                    "description": "Base58-encoded full 64-byte secret key."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name for the wallet. Defaults to \"Imported Wallet\" if omitted."
                  },
                  "set_active": {
                    "type": "boolean",
                    "description": "If true, marks the imported wallet as active. Defaults to false."
                  }
                },
                "required": [
                  "private_key"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/wallet/rename": {
      "post": {
        "summary": "Rename wallet",
        "description": "Renames an existing wallet owned by the tenant user. The rename is ownership-scoped — only wallets belonging to the caller can be renamed.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-rename",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Echoes the wallet_id and new name on success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "wallet_id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "wallet_id": 12,
                    "name": "Main Wallet"
                  }
                }
              }
            }
          },
          "400": {
            "description": "name is empty/whitespace (error.code=bad_request"
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallet_id": {
                    "type": "integer",
                    "description": "ID of the wallet to rename (must belong to the caller)."
                  },
                  "name": {
                    "type": "string",
                    "description": "New display name. Cannot be empty/whitespace."
                  }
                },
                "required": [
                  "wallet_id",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/wallet/switch": {
      "post": {
        "summary": "Switch active wallet",
        "description": "Sets the given wallet as the tenant user's active wallet. Scoped to the caller — only the user's own wallets can be activated.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-switch",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.active_wallet_id confirms the newly active wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "active_wallet_id": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "active_wallet_id": 12
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallet_id": {
                    "type": "integer",
                    "description": "ID of the wallet to make active (must belong to the caller)."
                  }
                },
                "required": [
                  "wallet_id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/wallet/withdraw": {
      "post": {
        "summary": "Withdraw SOL",
        "description": "Sends SOL from the user's active wallet to an external address on-chain. Validates the destination, amount bounds, active-wallet presence, and self-send. Requires an executor/RPC deployment.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-withdraw",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success, data.signature is the on-chain transfer signature; from is the active wallet pubkey. The send is executed from the caller's active wallet keypair, loaded server-side.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "signature": {
                          "type": "string"
                        },
                        "to_address": {
                          "type": "string"
                        },
                        "amount_sol": {
                          "type": "number"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "signature": "5Hx…",
                    "to_address": "9aBc…",
                    "amount_sol": 0.5,
                    "from": "7xK…"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid destination (bad_address), bad amount out of range (bad_amount), no active wallet (no_active_wallet), or destination equals own wallet (same_wallet); also insufficient balance (insufficient_balance"
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "wallet keypair load failure (error.code=wallet_load"
          },
          "502": {
            "description": "chain/RPC send failure (error.code=withdraw_failed"
          },
          "503": {
            "description": "trading/RPC not available in this (DB-only) deployment (error.code=no_rpc"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to_address": {
                    "type": "string",
                    "description": "Destination Solana address (base58 pubkey)."
                  },
                  "amount_sol": {
                    "type": "number",
                    "description": "Amount of SOL to send. Must be > 0 and ≤ 1,000,000."
                  }
                },
                "required": [
                  "to_address",
                  "amount_sol"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/wallet/{id}": {
      "delete": {
        "summary": "Delete wallet",
        "description": "Deletes a wallet by ID for the tenant user. Refuses to delete the user's last remaining wallet.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the wallet to delete (must belong to the caller)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success, data.deleted_wallet_id echoes the removed wallet id. Deletion is ownership-scoped to the caller.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted_wallet_id": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "deleted_wallet_id": 12
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "409": {
            "description": "cannot delete the last wallet (error.code=last_wallet"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (error.code=db"
          }
        }
      }
    },
    "/v1/wallet/migrate": {
      "post": {
        "summary": "Migrate wallet from legacy app",
        "description": "Imports a wallet from a legacy app's base58 64-byte secret key, stores it encrypted, and stamps migrated_at=NOW() plus source_app_id (the calling API app) so the terminal can track migrations. Optionally sets it active.",
        "tags": [
          "Trading API: Wallets"
        ],
        "operationId": "wallet-migrate",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.migrated is always true on success; the wallet row is stamped with migrated_at and source_app_id (resolved from the authenticated app, AuthCtx). is_generated is stored as FALSE.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "public_key": {
                          "type": "string"
                        },
                        "migrated": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 15,
                    "public_key": "4dW…",
                    "migrated": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "secret does not decode to exactly 64 bytes or is not a valid keypair (error.code=bad_secret"
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "API key lacks wallet scope"
          },
          "409": {
            "description": "duplicate wallet — public key already exists for this user (error.code=duplicate_wallet"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "encryption failure (error.code=crypto) or database error (error.code=db"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "secret_key_base58": {
                    "type": "string",
                    "description": "Base58-encoded full 64-byte secret key from the legacy app."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name for the migrated wallet."
                  },
                  "set_active": {
                    "type": "boolean",
                    "description": "If true, atomically makes this the user's active wallet. Defaults to false."
                  }
                },
                "required": [
                  "secret_key_base58",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/keys/challenge": {
      "post": {
        "summary": "Request key-issuance challenge",
        "description": "Mints a single-use, TTL-bound nonce and a human-readable message for a Solana wallet to sign (Phantom signMessage). The signed message later proves wallet ownership for self-serve key issuance/login. Public — no bearer auth; the wallet signature is the auth. Per-IP rate limited and optionally allowlist-gated.",
        "tags": [
          "Trading API: Keys & Sessions"
        ],
        "operationId": "keys-challenge",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.nonce + data.message are echoed back; the client must sign the EXACT message bytes. data.expires_in_secs is the challenge TTL (a platform setting, default 600). The nonce is NOT consumed here — only on a successful issue/login.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "wallet": {
                          "type": "string"
                        },
                        "nonce": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "expires_in_secs": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "wallet": "<base58-pubkey>",
                    "nonce": "a1b2c3...",
                    "message": "Stryke API — prove wallet ownership\n\nWallet: <wallet>\nNonce: <nonce>\nIssued: <rfc3339>\n\nSigning authorizes Stryke to issue an API key to this wallet.\nIt does NOT approve any transaction, transfer, or spend.",
                    "expires_in_secs": 600
                  }
                }
              }
            }
          },
          "400": {
            "description": "wallet is not a valid base58 32-byte Solana address (bad_wallet"
          },
          "403": {
            "description": "self-serve issuance disabled (self_serve_disabled) or wallet not on allowlist (wallet_not_allowed"
          },
          "429": {
            "description": "per-IP rate limit exceeded (rate_limited"
          },
          "500": {
            "description": "challenge could not be stored (challenge_store_failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Base58 Solana wallet address to issue/own the key."
                  }
                },
                "required": [
                  "wallet"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/keys/issue": {
      "post": {
        "summary": "Issue (or rotate) API key via signed challenge",
        "description": "Verifies the ed25519 signature over the exact challenge message, atomically consumes the single-use nonce, then issues a fresh API key bound to the wallet — or rotates the wallet's existing key (one key per wallet). The full key is returned ONCE; an encrypted recoverable copy is stored so it can be re-revealed later via the session. Also returns a wallet session token. Public — the wallet signature is the auth.",
        "tags": [
          "Trading API: Keys & Sessions"
        ],
        "operationId": "keys-issue",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.key is the full secret, shown ONCE. rotated=false means newly created, true means an existing key was rotated. scopes/tier/credits_monthly/rate_per_min/fee_bps come from SelfServeConfig env. session_token (HMAC-signed, default 7-day TTL) lets the wallet reveal/reset without re-signing; session_expires_at is a unix-seconds timestamp.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "key_prefix": {
                          "type": "string"
                        },
                        "rotated": {
                          "type": "boolean"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tier": {
                          "type": "string"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "fee_bps": {
                          "type": "number"
                        },
                        "session_token": {
                          "type": "string"
                        },
                        "session_expires_at": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "key": "rt_live_...",
                    "key_prefix": "rt_live_ab12",
                    "rotated": false,
                    "scopes": [
                      "read",
                      "trade"
                    ],
                    "tier": "free",
                    "credits_monthly": 10000,
                    "rate_per_min": 120,
                    "fee_bps": 100,
                    "session_token": "<b64url>.<b64url>",
                    "session_expires_at": 1790000000
                  }
                }
              }
            }
          },
          "400": {
            "description": "challenge not found/used/expired (challenge_invalid) or wallet doesn't match challenge (wallet_mismatch"
          },
          "401": {
            "description": "signature does not match wallet/message (bad_signature"
          },
          "403": {
            "description": "issuance disabled (self_serve_disabled), wallet not on allowlist (wallet_not_allowed), or the wallet's key was admin-disabled (key_disabled"
          },
          "429": {
            "description": "per-IP rate limit exceeded (rate_limited"
          },
          "500": {
            "description": "challenge lookup/keygen/encrypt/issue failure (challenge_lookup_failed, keygen, encrypt, issue_failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Base58 Solana wallet address; must match the challenge's wallet."
                  },
                  "nonce": {
                    "type": "string",
                    "description": "Nonce returned by /v1/keys/challenge."
                  },
                  "signature": {
                    "type": "string",
                    "description": "ed25519 signature over the challenge message — base64 (preferred) or base58."
                  }
                },
                "required": [
                  "wallet",
                  "nonce",
                  "signature"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/keys/login": {
      "post": {
        "summary": "Wallet login (start session)",
        "description": "Proves wallet ownership once via a signed challenge and returns a session token (default 7 days) without issuing a key. Reports whether the wallet already has a key and whether it is revealable, so a portal can show Reveal/Reset vs Generate. Public — the wallet signature is the auth.",
        "tags": [
          "Trading API: Keys & Sessions"
        ],
        "operationId": "keys-login",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "session_token (HMAC-signed, a platform setting, default 7d) + session_expires_at (unix secs). has_key = wallet already has an enabled key. key_prefix is null if none. revealable = an encrypted copy exists AND the key is enabled (older keys predating self-reveal are not revealable).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "session_token": {
                          "type": "string"
                        },
                        "session_expires_at": {
                          "type": "number"
                        },
                        "has_key": {
                          "type": "boolean"
                        },
                        "key_prefix": {
                          "type": "string"
                        },
                        "revealable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "session_token": "<b64url>.<b64url>",
                    "session_expires_at": 1790000000,
                    "has_key": true,
                    "key_prefix": "rt_live_ab12",
                    "revealable": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "challenge not found/used/expired (challenge_invalid) or wallet doesn't match challenge (wallet_mismatch"
          },
          "401": {
            "description": "signature does not match wallet/message (bad_signature"
          },
          "403": {
            "description": "issuance disabled (self_serve_disabled) or wallet not on allowlist (wallet_not_allowed"
          },
          "429": {
            "description": "per-IP rate limit exceeded (rate_limited"
          },
          "500": {
            "description": "challenge lookup failure (challenge_lookup_failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Base58 Solana wallet address; must match the challenge's wallet."
                  },
                  "nonce": {
                    "type": "string",
                    "description": "Nonce returned by /v1/keys/challenge."
                  },
                  "signature": {
                    "type": "string",
                    "description": "ed25519 signature over the challenge message — base64 or base58."
                  }
                },
                "required": [
                  "wallet",
                  "nonce",
                  "signature"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/keys/reveal": {
      "post": {
        "summary": "Reveal full API key (session)",
        "description": "Returns the FULL API key for the session wallet, decrypted server-side from the stored recoverable copy. Requires a valid session token (obtained via /v1/keys/issue or /v1/keys/login) — no new signature needed. Public route; the session token is the auth.",
        "tags": [
          "Trading API: Keys & Sessions"
        ],
        "operationId": "keys-reveal",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.key is the decrypted full secret; key_prefix is its public prefix.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "key_prefix": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "key": "rt_live_...",
                    "key_prefix": "rt_live_ab12"
                  }
                }
              }
            }
          },
          "401": {
            "description": "session token expired/invalid (session_invalid"
          },
          "403": {
            "description": "the wallet's key was admin-disabled (key_disabled"
          },
          "404": {
            "description": "no key exists for this wallet yet (no_key"
          },
          "409": {
            "description": "key predates self-reveal — no encrypted copy stored, must reset (not_revealable"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "DB lookup / decrypt failure (db, decrypt"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "Wallet session token from /v1/keys/login or /v1/keys/issue."
                  }
                },
                "required": [
                  "session_token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/keys/reset": {
      "post": {
        "summary": "Reset (rotate) API key (session)",
        "description": "Rotates — or first-time generates — the session wallet's API key. The previous key stops working immediately and a fresh full key is returned once. Requires a valid session token; no new signature needed. Public route; the session token is the auth.",
        "tags": [
          "Trading API: Keys & Sessions"
        ],
        "operationId": "keys-reset",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.key is the new full secret, shown once. rotated=true if a key existed before (false on first-time generate). scopes/tier/credits_monthly/rate_per_min/fee_bps reflect the issued app config. No new session_token is returned (the existing session stays valid).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "key_prefix": {
                          "type": "string"
                        },
                        "rotated": {
                          "type": "boolean"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tier": {
                          "type": "string"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "fee_bps": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "key": "rt_live_...",
                    "key_prefix": "rt_live_cd34",
                    "rotated": true,
                    "scopes": [
                      "read",
                      "trade"
                    ],
                    "tier": "free",
                    "credits_monthly": 10000,
                    "rate_per_min": 120,
                    "fee_bps": 100
                  }
                }
              }
            }
          },
          "401": {
            "description": "session token expired/invalid (session_invalid"
          },
          "403": {
            "description": "the wallet's key was admin-disabled (key_disabled"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "keygen/encrypt/issue failure (keygen, encrypt, issue_failed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "Wallet session token from /v1/keys/login or /v1/keys/issue."
                  }
                },
                "required": [
                  "session_token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/tiers": {
      "get": {
        "summary": "List paid tiers",
        "description": "Public pricing list: every tier from the operator-editable api_tiers table with USD price, a live SOL-lamports quote (price_usd / live SOL price), credits, rate limits, stake eligibility, plus the payment treasury address. Drives the pricing page so a client can build the exact SOL payment.",
        "tags": [
          "Trading API: Billing & Tiers"
        ],
        "operationId": "billing-tiers",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.tiers[]: name (tier id), display_name, price_usd, price_sol_lamports (null when price is 0 or SOL price unavailable), credits_monthly (null = unlimited), unlimited (credits_monthly is null), rate_per_min, stake_min (raw $STRYKE units), stake_eligible (stake_min > 0), window_days. Top level: pay_currency always \"sol\", sol_price_usd (null if unavailable), treasury (null if unconfigured), stake_rail_enabled (whether STRYKE_MINT is set).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tiers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "display_name": {
                                "type": "string"
                              },
                              "price_usd": {
                                "type": "number"
                              },
                              "price_sol_lamports": {
                                "type": "number"
                              },
                              "credits_monthly": {
                                "type": "number"
                              },
                              "unlimited": {
                                "type": "boolean"
                              },
                              "rate_per_min": {
                                "type": "number"
                              },
                              "stake_min": {
                                "type": "number"
                              },
                              "stake_eligible": {
                                "type": "boolean"
                              },
                              "window_days": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "pay_currency": {
                          "type": "string"
                        },
                        "sol_price_usd": {
                          "type": "number"
                        },
                        "treasury": {
                          "type": "string"
                        },
                        "stake_rail_enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "tiers": [
                      {
                        "name": "pro",
                        "display_name": "Pro",
                        "price_usd": 49,
                        "price_sol_lamports": 326666666,
                        "credits_monthly": 100000,
                        "unlimited": false,
                        "rate_per_min": 120,
                        "stake_min": 0,
                        "stake_eligible": false,
                        "window_days": 30
                      }
                    ],
                    "pay_currency": "sol",
                    "sol_price_usd": 150,
                    "treasury": "4xK...treasuryPubkey",
                    "stake_rail_enabled": true
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error reading tiers (error code \"db\""
          }
        }
      }
    },
    "/v1/billing/status": {
      "post": {
        "summary": "Billing status for session key",
        "description": "Returns the current tier, credit quota/usage, rate limit, and tier expiry for the API key owned by the wallet behind the session token. Resolves session -> wallet -> self-serve app id in-handler.",
        "tags": [
          "Trading API: Billing & Tiers"
        ],
        "operationId": "billing-status",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.tier (nullable), credits_monthly (null = unlimited), credits_used, credits_remaining (null when unlimited; else max(monthly-used,0)), unlimited (credits_monthly is null), rate_per_min, tier_expires_at (RFC3339, null if no expiry).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "credits_used": {
                          "type": "number"
                        },
                        "credits_remaining": {
                          "type": "number"
                        },
                        "unlimited": {
                          "type": "boolean"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "tier_expires_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "tier": "pro",
                    "credits_monthly": 100000,
                    "credits_used": 42,
                    "credits_remaining": 99958,
                    "unlimited": false,
                    "rate_per_min": 120,
                    "tier_expires_at": "2026-07-26T00:00:00+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "session expired or invalid (code session_invalid"
          },
          "403": {
            "description": "this wallet's API key is disabled (code key_disabled"
          },
          "404": {
            "description": "no API key for this wallet (code no_key), or app row not found"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error (code db"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "Wallet session token from POST /v1/keys/login. Verified server-side (HMAC) to resolve the owner wallet and its self-serve API key."
                  }
                },
                "required": [
                  "session_token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/billing/pay": {
      "post": {
        "summary": "Pay (SOL) and apply tier",
        "description": "Verifies an on-chain SOL payment and applies the chosen paid tier to the session wallet's API key. Confirms the tx succeeded, was sent from the session wallet (fee payer / account index 0), and credited the treasury >= the tier price (priced in USD, converted at live SOL price with a drift tolerance). Records the signature single-use (atomic redeem) so it can't be replayed.",
        "tags": [
          "Trading API: Billing & Tiers"
        ],
        "operationId": "billing-pay",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.tier (applied tier name), credits_monthly (null = unlimited), rate_per_min, tier_expires_at (RFC3339, end of tier window), paid_lamports (lamports the treasury actually received in the verified tx).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "tier_expires_at": {
                          "type": "string"
                        },
                        "paid_lamports": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "tier": "pro",
                    "credits_monthly": 100000,
                    "rate_per_min": 120,
                    "tier_expires_at": "2026-07-26T00:00:00+00:00",
                    "paid_lamports": 326700000
                  }
                }
              }
            }
          },
          "400": {
            "description": "currency != sol (unsupported_currency); tier is free (free_tier); unknown tier (unknown_tier); invalid session wallet (bad_wallet); payment could not be verified on-chain — tx failed, wrong payer, treasury not credited, or underpaid (payment_unverified"
          },
          "401": {
            "description": "session expired or invalid (session_invalid"
          },
          "402": {
            "description": "not used here"
          },
          "403": {
            "description": "this wallet's API key is disabled (key_disabled"
          },
          "404": {
            "description": "no API key for this wallet (no_key"
          },
          "409": {
            "description": "this tx_signature was already redeemed (payment_already_used"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error (db) or tier-apply/redeem failure (redeem_failed"
          },
          "503": {
            "description": "billing treasury not configured (billing_unconfigured); RPC not available in this deployment (no_rpc); SOL price unavailable (no_sol_price"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "Wallet session token from POST /v1/keys/login; binds the payment to the owner wallet."
                  },
                  "tier": {
                    "type": "string",
                    "description": "Tier name to purchase (must be a paid tier with price_usd > 0)."
                  },
                  "currency": {
                    "type": "string",
                    "description": "Payment currency. Defaults to \"sol\"; only \"sol\" is accepted (USDC reserved for later)."
                  },
                  "tx_signature": {
                    "type": "string",
                    "description": "Signature of the on-chain SOL transfer to the treasury. Must be confirmed, successful, sent from the session wallet, and credit the treasury >= the (tolerance-adjusted) tier price."
                  }
                },
                "required": [
                  "session_token",
                  "tier",
                  "tx_signature"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/billing/stake-check": {
      "post": {
        "summary": "Stake-check ($STRYKE) tier grant",
        "description": "Checks the session wallet's $STRYKE balance (held in its ATA) and grants the highest-priced tier whose stake_min it meets. Re-checkable; does not reset the credit window unless the tier actually changes, and the tier lapses at window end if the holder drops below the threshold.",
        "tags": [
          "Trading API: Billing & Tiers"
        ],
        "operationId": "billing-stake-check",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.tier (granted tier name), stryke_balance (raw $STRYKE units in the wallet's ATA), credits_monthly (null = unlimited), rate_per_min, tier_expires_at (RFC3339, end of window). Each grant is audited with a synthetic stake:<wallet>:<tier>:<micros> signature.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string"
                        },
                        "stryke_balance": {
                          "type": "number"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "tier_expires_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "tier": "pro",
                    "stryke_balance": 5000000,
                    "credits_monthly": 100000,
                    "rate_per_min": 120,
                    "tier_expires_at": "2026-07-26T00:00:00+00:00"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet (bad_wallet"
          },
          "401": {
            "description": "session expired or invalid (session_invalid"
          },
          "402": {
            "description": "$STRYKE balance below every stakeable tier's stake_min (insufficient_stake"
          },
          "403": {
            "description": "this wallet's API key is disabled (key_disabled"
          },
          "404": {
            "description": "no API key for this wallet (no_key"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error reading tiers (db) or tier-apply failure (apply_failed"
          },
          "503": {
            "description": "$STRYKE stake rail not enabled / STRYKE_MINT unset (stake_disabled); RPC not available (no_rpc"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "Wallet session token from POST /v1/keys/login; identifies the wallet whose $STRYKE balance is checked."
                  }
                },
                "required": [
                  "session_token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/tokens/verified": {
      "get": {
        "summary": "List verified tokens",
        "description": "Public list of all mints that currently hold an active paid 'Verified by Stryke' badge. Reads the verified-token table directly (the deepscan engine uses this as a warm cache); always works regardless of whether badge granting is enabled.",
        "tags": [
          "Trading API: Token Verification"
        ],
        "operationId": "tokens-verified-list",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "data.verified[] = active verified mints; each has mint, since (RFC3339 verified_at), score_at_verify (Deep Scan score at grant time). data.count = number of entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "since": {
                                "type": "string"
                              },
                              "score_at_verify": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "count": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "verified": [
                      {
                        "mint": "So11111111111111111111111111111111111111112",
                        "since": "2026-06-25T12:00:00+00:00",
                        "score_at_verify": 86
                      }
                    ],
                    "count": 1
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error reading verified set"
          }
        }
      }
    },
    "/v1/tokens/{mint}/verification": {
      "get": {
        "summary": "Get token verification status",
        "description": "Public per-token verification lookup. Returns whether a single mint holds an active 'Verified by Stryke' badge; the deepscan engine polls this (fail-open, cached) to decide whether to render the badge. Score-neutral — never affects the token's safety score.",
        "tags": [
          "Trading API: Token Verification"
        ],
        "operationId": "tokens-verification-get",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint address to look up (trimmed)."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "When active: verified=true, status=\"active\", mint, since (RFC3339), score_at_verify. When not verified (no row or non-active): verified=false, status=\"none\", mint only.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": "string"
                        },
                        "mint": {
                          "type": "string"
                        },
                        "since": {
                          "type": "string"
                        },
                        "score_at_verify": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "verified": true,
                    "status": "active",
                    "mint": "So11111111111111111111111111111111111111112",
                    "since": "2026-06-25T12:00:00+00:00",
                    "score_at_verify": 86
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error reading verification row"
          }
        }
      }
    },
    "/v1/tokens/verify": {
      "post": {
        "summary": "Verify token (grant badge)",
        "description": "Wallet-session + on-chain SOL payment + Deep Scan score gate that grants a paid 'Verified by Stryke' badge to a mint. Requires a valid HMAC wallet session, a confirmed SOL payment from that wallet to the verify/billing treasury (live SOL pricing with drift tolerance), and a current Deep Scan score >= the configured bar. Atomic grant with anti-replay (one tx signature can verify exactly one token). Revenue routes to the trEnD treasury.",
        "tags": [
          "Trading API: Token Verification"
        ],
        "operationId": "tokens-verify",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "On success: verified=true, mint, score_at_verify (Deep Scan score that cleared the gate), paid_lamports (lamports the treasury actually received). Errors use {success:false, error:{code,message}}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "mint": {
                          "type": "string"
                        },
                        "score_at_verify": {
                          "type": "number"
                        },
                        "paid_lamports": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "verified": true,
                    "mint": "So11111111111111111111111111111111111111112",
                    "score_at_verify": 86,
                    "paid_lamports": 12345678
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid mint (bad_mint), invalid session wallet (bad_wallet), or payment could not be verified — wrong payer/treasury/amount or bad signature (payment_unverified"
          },
          "401": {
            "description": "session expired or invalid (session_invalid"
          },
          "409": {
            "description": "the tx signature was already redeemed for a verification (payment_already_used"
          },
          "422": {
            "description": "token scored below the required bar (score_too_low) — not charged for the badge"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error during atomic grant (verify_failed"
          },
          "502": {
            "description": "Deep Scan engine unreachable / could not score the token; gate fails closed (scan_unavailable"
          },
          "503": {
            "description": "feature disabled a platform setting off (verify_disabled), treasury unconfigured (verify_unconfigured), price unset VERIFY_PRICE_USD<=0 (verify_unpriced), no RPC in deployment (no_rpc), or SOL price unavailable (no_sol_price"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_token": {
                    "type": "string",
                    "description": "HMAC wallet session token from the keys/billing wallet-sig flow; identifies the paying wallet."
                  },
                  "mint": {
                    "type": "string",
                    "description": "Token mint address to verify (must be a valid pubkey)."
                  },
                  "tx_signature": {
                    "type": "string",
                    "description": "Signature of the on-chain SOL payment tx (payer must equal the session wallet; treasury must receive >= the SOL-priced fee minus tolerance). Single-use."
                  }
                },
                "required": [
                  "session_token",
                  "mint",
                  "tx_signature"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/quests/projects": {
      "post": {
        "summary": "Create quest project",
        "description": "Creates a quest project in the Node quests engine. Thin metered proxy: the Rust layer authenticates the app key + `quests` scope, charges credits, then forwards the body verbatim with the authenticated `app.id` as `x-stryke-app-id`, which the engine uses to enforce per-tenant ownership (a project's `stryke_app_id` must match the calling app).",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-create-project",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body is the quests-engine's JSON forwarded verbatim (Content-Type application/json); field shape is owned by the engine. The `success` boolean drives credit settlement. On proxy faults the Rust layer returns its own envelope: `{\"success\":false,\"error\":{\"code\":...,\"message\":...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined project fields"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks the `quests` scope"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable (quests_engine_unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured (quests_unconfigured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "<engine fields>": {
                    "type": "object",
                    "description": "Free-form JSON forwarded verbatim to the quests engine's POST /quests/projects (e.g. project name/config). Body shape is owned by the Node quests-engine, not this proxy."
                  }
                },
                "required": [
                  "<engine fields>"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/quests/projects/{pid}/credentials": {
      "post": {
        "summary": "Set project credentials",
        "description": "Stores per-project verification credentials (e.g. X/Reddit/Discord API secrets) for project `pid` in the quests engine's encrypted vault. Forwards the body verbatim with the authenticated app id; engine rejects if `pid` is not owned by the calling app.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-put-credentials",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Quest project id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{\"code\":...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined fields"
                }
              }
            }
          },
          "400": {
            "description": "invalid path param (pid not an integer"
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope, or project not owned by app (engine-enforced"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "<engine fields>": {
                    "type": "object",
                    "description": "Free-form JSON of provider credentials forwarded verbatim to POST /quests/projects/{pid}/credentials. Shape owned by the quests-engine."
                  }
                },
                "required": [
                  "<engine fields>"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "Get project credentials",
        "description": "Returns the (redacted) credential configuration for project `pid` from the quests engine. Proxy forwards the authenticated app id; engine enforces project ownership.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-get-credentials",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Quest project id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine; secrets are redacted engine-side. Proxy faults use the `{\"success\":false,\"error\":{...}}` envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined redacted credential fields"
                }
              }
            }
          },
          "400": {
            "description": "invalid path param (pid not an integer"
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope, or project not owned by app"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        }
      }
    },
    "/v1/quests/campaigns": {
      "post": {
        "summary": "Create campaign",
        "description": "Creates a campaign (a grouping of tasks under a project) in the quests engine. Body forwarded verbatim with the authenticated app id for per-tenant ownership.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-create-campaign",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined campaign fields"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope, or referenced project not owned by app"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "<engine fields>": {
                    "type": "object",
                    "description": "Free-form JSON forwarded verbatim to POST /quests/campaigns (e.g. project_id, name, schedule). Shape owned by the quests-engine."
                  }
                },
                "required": [
                  "<engine fields>"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/quests/tasks": {
      "post": {
        "summary": "Create task",
        "description": "Creates a verifiable task (e.g. follow/retweet/join/on-chain action) under a campaign in the quests engine. Body forwarded verbatim with the authenticated app id.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-create-task",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined task fields"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope, or referenced campaign/project not owned by app"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "<engine fields>": {
                    "type": "object",
                    "description": "Free-form JSON forwarded verbatim to POST /quests/tasks (e.g. campaign_id, type, target, reward). Shape owned by the quests-engine."
                  }
                },
                "required": [
                  "<engine fields>"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "List tasks",
        "description": "Lists tasks from the quests engine, scoped to the calling app. All query-string params are passed through verbatim (percent-encoded) to the engine's GET /quests/tasks.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-list-tasks",
        "parameters": [
          {
            "name": "<engine filters>",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Arbitrary filter params (e.g. campaign_id, project_id, status) forwarded verbatim to the quests-engine. Accepted params are defined by the engine."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined task list"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        }
      }
    },
    "/v1/quests/verify": {
      "post": {
        "summary": "Verify quest task",
        "description": "Submits a task completion attempt for verification (the billable unit of the Quests API). The engine performs the actual check (X/Reddit/Discord/on-chain). Charge-per-attempt: the credit reservation is kept on any 2xx success:true, including verified:false, since the upstream cost was incurred.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-verify",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine; `verified` reflects whether the task passed. Treated as an EXECUTION path: a 2xx with success:true keeps the credit charge even when verified:false. Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "verified": true,
                  "...": "engine-defined verification result"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope, or task not owned by app"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "<engine fields>": {
                    "type": "object",
                    "description": "Free-form JSON forwarded verbatim to POST /quests/verify (e.g. task_id, wallet/user identity, proof). Shape owned by the quests-engine."
                  }
                },
                "required": [
                  "<engine fields>"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/quests/status": {
      "get": {
        "summary": "Quest status",
        "description": "Returns task/campaign completion status for a participant from the quests engine, scoped to the calling app. Query params forwarded verbatim.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-status",
        "parameters": [
          {
            "name": "<engine filters>",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Arbitrary params (e.g. wallet/user id, campaign_id, task_id) forwarded verbatim to the quests-engine's GET /quests/status."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined status fields"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        }
      }
    },
    "/v1/quests/leaderboard": {
      "get": {
        "summary": "Quest leaderboard",
        "description": "Returns the participant leaderboard for a campaign/project from the quests engine, scoped to the calling app. Query params forwarded verbatim.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-leaderboard",
        "parameters": [
          {
            "name": "<engine filters>",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Arbitrary params (e.g. campaign_id, project_id, limit) forwarded verbatim to the quests-engine's GET /quests/leaderboard."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined leaderboard entries"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "402": {
            "description": "insufficient credits / quota exceeded"
          },
          "403": {
            "description": "API key lacks `quests` scope"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        }
      }
    },
    "/v1/quests/usage": {
      "get": {
        "summary": "Quests usage",
        "description": "Returns the quests engine's per-app usage/metering snapshot (verify counts, etc.), scoped to the calling app. Free — not credit-charged (paths ending in /usage cost 0). Query params forwarded verbatim.",
        "tags": [
          "Trading API: Quests"
        ],
        "operationId": "quests-usage",
        "parameters": [
          {
            "name": "<engine filters>",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Arbitrary params (e.g. window/period) forwarded verbatim to the quests-engine's GET /quests/usage."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "2xx body forwarded verbatim from the quests-engine (application/json). Proxy faults use `{\"success\":false,\"error\":{...}}`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "...": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "...": "engine-defined usage counters"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid Bearer API key"
          },
          "403": {
            "description": "API key lacks `quests` scope"
          },
          "429": {
            "description": "per-app rate limit exceeded"
          },
          "502": {
            "description": "quests engine unreachable"
          },
          "503": {
            "description": "QUESTS_INTERNAL_KEY not configured"
          }
        }
      }
    },
    "/v1/settings": {
      "get": {
        "summary": "Get user settings",
        "description": "Returns the full settings dump for the tenant user resolved from the X-User-Ref header (slippage, gas, MEV flags, quick buy/sell presets, PNL card prefs, withdraw address). Per-tenant: the user is resolved from X-User-Ref scoped to the calling app.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-get",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "settings is the UserProfile row: locale; default_buy_amount + default_slippage_bps; buy_amounts (5 lamport presets) + buy_slippage_bps; sell_percents (4 pct presets) + sell_slippage_bps; priority_fee_lamports, gas_cu_limit, gas_cu_price, gas_tip; confirm_trades, mev_protect_buy, mev_protect_sell, sell_protection; pnl_cards_* prefs; autosell_profile_id (nullable); withdraw_address (nullable) + withdraw_address_locked; created_at + last_active timestamps. On the not-found path returns {\"success\":false,\"error\":\"User not found. Send any trade first to auto-create.\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "locale": {
                          "type": "string"
                        },
                        "default_buy_amount": {
                          "type": "number"
                        },
                        "default_slippage_bps": {
                          "type": "number"
                        },
                        "buy_amounts": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "buy_slippage_bps": {
                          "type": "number"
                        },
                        "sell_percents": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        },
                        "priority_fee_lamports": {
                          "type": "number"
                        },
                        "gas_cu_limit": {
                          "type": "number"
                        },
                        "gas_cu_price": {
                          "type": "number"
                        },
                        "gas_tip": {
                          "type": "number"
                        },
                        "confirm_trades": {
                          "type": "boolean"
                        },
                        "mev_protect_buy": {
                          "type": "boolean"
                        },
                        "mev_protect_sell": {
                          "type": "boolean"
                        },
                        "sell_protection": {
                          "type": "boolean"
                        },
                        "pnl_cards_enabled": {
                          "type": "boolean"
                        },
                        "pnl_cards_hide_losses": {
                          "type": "boolean"
                        },
                        "pnl_cards_hide_amounts": {
                          "type": "boolean"
                        },
                        "pnl_cards_show_qr": {
                          "type": "boolean"
                        },
                        "autosell_profile_id": {},
                        "withdraw_address": {},
                        "withdraw_address_locked": {
                          "type": "boolean"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "last_active": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "settings": {
                    "locale": "en",
                    "default_buy_amount": 500000000,
                    "default_slippage_bps": 1500,
                    "buy_amounts": [
                      100000000,
                      250000000,
                      500000000,
                      1000000000,
                      2500000000
                    ],
                    "buy_slippage_bps": 1500,
                    "sell_percents": [
                      25,
                      50,
                      75,
                      100
                    ],
                    "sell_slippage_bps": 1500,
                    "priority_fee_lamports": 0,
                    "gas_cu_limit": 0,
                    "gas_cu_price": 0,
                    "gas_tip": 0,
                    "confirm_trades": true,
                    "mev_protect_buy": false,
                    "mev_protect_sell": false,
                    "sell_protection": false,
                    "pnl_cards_enabled": true,
                    "pnl_cards_hide_losses": false,
                    "pnl_cards_hide_amounts": false,
                    "pnl_cards_show_qr": false,
                    "autosell_profile_id": null,
                    "withdraw_address": null,
                    "withdraw_address_locked": false,
                    "created_at": "2026-01-01T00:00:00Z",
                    "last_active": "2026-06-01T00:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key (auth middleware"
          },
          "403": {
            "description": "API key lacks read scope (scope middleware"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "put": {
        "summary": "Update user settings (batch)",
        "description": "Batch-updates any subset of user settings — only fields present in the JSON body are applied, omitted fields are left unchanged. Each field is validated and written independently; the response reports which fields were updated and any per-field errors. Per-tenant: user resolved from X-User-Ref.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-update",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On full success: {\"success\":true,\"updated\":[<field names applied>]}. If any field failed validation or its DB write errored: {\"success\":false,\"updated\":[<fields that succeeded>],\"errors\":[<per-field error strings>]} — partial writes are NOT rolled back (already-applied fields persist). Validation errors include 'Invalid locale...', 'buy_slippage_bps must be 0-10000', 'priority_fee_lamports must be >= 0', etc.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "updated": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "updated": [
                    "locale",
                    "buy_slippage_bps",
                    "mev_protect_buy"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson extractor rejects before handler"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "description": "UI locale. Must be one of en, ru, zh-CN, es."
                  },
                  "buy_slippage_bps": {
                    "type": "integer",
                    "description": "Buy slippage in bps, 0-10000."
                  },
                  "sell_slippage_bps": {
                    "type": "integer",
                    "description": "Sell slippage in bps, 0-10000."
                  },
                  "priority_fee_lamports": {
                    "type": "integer",
                    "description": "Priority fee in lamports, must be >= 0."
                  },
                  "gas_cu_price": {
                    "type": "integer",
                    "description": "Compute-unit price, must be >= 0."
                  },
                  "gas_cu_limit": {
                    "type": "integer",
                    "description": "Compute-unit limit, must be >= 0 (written via raw SQL)."
                  },
                  "gas_tip": {
                    "type": "number",
                    "description": "Gas tip in SOL, must be >= 0 (written via raw SQL)."
                  },
                  "mev_protect_buy": {
                    "type": "boolean",
                    "description": "Enable MEV protection on buys."
                  },
                  "mev_protect_sell": {
                    "type": "boolean",
                    "description": "Enable MEV protection on sells."
                  },
                  "sell_protection": {
                    "type": "boolean",
                    "description": "Enable sell protection."
                  },
                  "confirm_trades": {
                    "type": "boolean",
                    "description": "Require trade confirmation dialog."
                  },
                  "pnl_cards_enabled": {
                    "type": "boolean",
                    "description": "Enable PNL cards."
                  },
                  "pnl_cards_hide_losses": {
                    "type": "boolean",
                    "description": "Hide losing trades on PNL cards."
                  },
                  "pnl_cards_hide_amounts": {
                    "type": "boolean",
                    "description": "Hide amounts on PNL cards."
                  },
                  "pnl_cards_show_qr": {
                    "type": "boolean",
                    "description": "Show QR code on PNL cards."
                  },
                  "autosell_profile_id": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Autosell profile id. Nested-optional: omit = skip, null = clear, value = set."
                  },
                  "withdraw_address": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Withdraw destination. Nested-optional: omit = skip, null or empty string = clear, value = set."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/settings/buy-amounts": {
      "put": {
        "summary": "Set quick-buy amounts",
        "description": "Sets the 5 quick-buy preset amounts (in lamports) for the tenant user. Requires exactly 5 positive values; writes them to buy_amount_1..5 (1-based index). Per-tenant: user resolved from X-User-Ref.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-set-buy-amounts",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success echoes back the saved buy_amounts array. On validation/DB failure returns {\"success\":false,\"error\":\"<message>\"} (e.g. 'Expected exactly 5 buy amounts in lamports', 'Amount at index N must be > 0', 'Failed to set buy_amount_N:...').",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "buy_amounts": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "buy_amounts": [
                    100000000,
                    250000000,
                    500000000,
                    1000000000,
                    2500000000
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson extractor"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amounts": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Exactly 5 buy amounts in lamports, each > 0."
                  }
                },
                "required": [
                  "amounts"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/settings/sell-percents": {
      "put": {
        "summary": "Set quick-sell percentages",
        "description": "Sets the 4 quick-sell preset percentages for the tenant user. Requires exactly 4 values each in 1-100; writes them to sell_percent_1..4 (1-based index). Per-tenant: user resolved from X-User-Ref.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-set-sell-percents",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success echoes back the saved sell_percents array. On validation/DB failure returns {\"success\":false,\"error\":\"<message>\"} (e.g. 'Expected exactly 4 sell percentages', 'Percent at index N must be 1-100', 'Failed to set sell_percent_N:...').",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "sell_percents": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "sell_percents": [
                    25,
                    50,
                    75,
                    100
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson extractor"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "percents": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Exactly 4 sell percentages, each 1-100."
                  }
                },
                "required": [
                  "percents"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/settings/reset-buy": {
      "post": {
        "summary": "Reset buy settings",
        "description": "Resets the tenant user's buy settings (quick-buy amounts, default buy amount, buy slippage) to system defaults. Per-tenant: user resolved from X-User-Ref.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-reset-buy",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success returns the applied defaults: buy_amounts [0.1, 0.25, 0.5, 1.0, 2.5 SOL in lamports], default_buy_amount 500000000, buy_slippage_bps 1500. On failure returns {\"success\":false,\"error\":\"Failed to reset buy settings:...\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "defaults": {
                      "type": "object",
                      "properties": {
                        "buy_amounts": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "default_buy_amount": {
                          "type": "number"
                        },
                        "buy_slippage_bps": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Buy settings reset to defaults",
                  "defaults": {
                    "buy_amounts": [
                      100000000,
                      250000000,
                      500000000,
                      1000000000,
                      2500000000
                    ],
                    "default_buy_amount": 500000000,
                    "buy_slippage_bps": 1500
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/settings/reset-sell": {
      "post": {
        "summary": "Reset sell settings",
        "description": "Resets the tenant user's sell settings (quick-sell percentages and sell slippage) to system defaults. Per-tenant: user resolved from X-User-Ref.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "settings-reset-sell",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success returns the applied defaults: sell_percents [25,50,75,100], sell_slippage_bps 1500. On failure returns {\"success\":false,\"error\":\"Failed to reset sell settings:...\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "defaults": {
                      "type": "object",
                      "properties": {
                        "sell_percents": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Sell settings reset to defaults",
                  "defaults": {
                    "sell_percents": [
                      25,
                      50,
                      75,
                      100
                    ],
                    "sell_slippage_bps": 1500
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/rewards/profile": {
      "get": {
        "summary": "Get rewards profile",
        "description": "Returns the calling user's XP, level, daily streak, referral code, and unclaimed cashback/referral balances, plus computed progress toward the next level. Scoped to the authenticated user (resolved from X-User-Ref); auto-creates a rewards row on first access.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "rewards-profile",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.current_xp/total_xp_earned = XP counters; level = current_level; streak = daily_streak; last_trade_at = last trade date (string or null); referral_code = user's invite code; cashback_balance_lamports/referral_balance_lamports = unclaimed amounts in lamports; next_level_xp = XP threshold for next level (0 at max level); progress_pct = 0-100 progress within current level.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "current_xp": {
                          "type": "number"
                        },
                        "total_xp_earned": {
                          "type": "number"
                        },
                        "level": {
                          "type": "number"
                        },
                        "streak": {
                          "type": "number"
                        },
                        "last_trade_at": {
                          "type": "string"
                        },
                        "referral_code": {
                          "type": "string"
                        },
                        "cashback_balance_lamports": {
                          "type": "number"
                        },
                        "referral_balance_lamports": {
                          "type": "number"
                        },
                        "next_level_xp": {
                          "type": "number"
                        },
                        "progress_pct": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "current_xp": 1250,
                    "total_xp_earned": 3400,
                    "level": 4,
                    "streak": 7,
                    "last_trade_at": "2026-06-25",
                    "referral_code": "AB12CD",
                    "cashback_balance_lamports": 150000,
                    "referral_balance_lamports": 80000,
                    "next_level_xp": 2000,
                    "progress_pct": 62.5
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user ref — require_user fails (error_response envelope, HTTP 200-style success:false body"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error fetching user rewards or reward levels"
          }
        }
      }
    },
    "/v1/rewards/achievements": {
      "get": {
        "summary": "List achievements",
        "description": "Returns the full achievement catalog merged with the calling user's unlock status and unlock timestamps. Scoped to the authenticated user (resolved from X-User-Ref).",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "rewards-achievements",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.total = catalog size; data.unlocked = count unlocked by user; achievements[] = every achievement with id/name/description/icon/xp_reward/category plus unlocked (bool) and unlocked_at (unix epoch i64 or null).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "unlocked": {
                          "type": "number"
                        },
                        "achievements": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "number"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "xp_reward": {
                                "type": "number"
                              },
                              "category": {
                                "type": "string"
                              },
                              "unlocked": {
                                "type": "boolean"
                              },
                              "unlocked_at": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 24,
                    "unlocked": 5,
                    "achievements": [
                      {
                        "id": 1,
                        "name": "First Trade",
                        "description": "Complete your first trade",
                        "icon": "star",
                        "xp_reward": 100,
                        "category": "trading",
                        "unlocked": true,
                        "unlocked_at": 1719273600
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user ref — require_user fails (error_response envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error fetching achievements or user achievements"
          }
        }
      }
    },
    "/v1/rewards/referral-stats": {
      "get": {
        "summary": "Get referral stats",
        "description": "Returns the calling user's multi-level referral tree stats (per-depth commission earned and user counts) plus the direct (depth-1) referral count. Scoped to the authenticated user.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "rewards-referral-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.direct_referrals = count of direct referrals; stats[] = per referral-tree depth: depth (level below user), total_commission_lamports (sum earned at that depth, lamports), total_trades (user_count at that depth).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "direct_referrals": {
                          "type": "number"
                        },
                        "stats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "depth": {
                                "type": "number"
                              },
                              "total_commission_lamports": {
                                "type": "number"
                              },
                              "total_trades": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "direct_referrals": 3,
                    "stats": [
                      {
                        "depth": 1,
                        "total_commission_lamports": 420000,
                        "total_trades": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user ref — require_user fails (error_response envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error fetching referral stats or counting direct referrals"
          }
        }
      }
    },
    "/v1/rewards/leaderboard": {
      "get": {
        "summary": "XP leaderboard",
        "description": "Returns the top users ranked by XP descending. PII-safe: raw telegram_id is never exposed — each entry gets a rank-derived anon handle (\"anon-1\", \"anon-2\",...). App-wide (not per-user).",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "rewards-leaderboard",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max entries to return; defaults to 10, capped at 100."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.leaderboard[] sorted by xp DESC: rank (1-based), handle (rank-derived anon-N, NOT a resolvable id — v0.7.265 PII fix), xp (current_xp), level (current_level), streak (daily_streak).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "leaderboard": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rank": {
                                "type": "number"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "xp": {
                                "type": "number"
                              },
                              "level": {
                                "type": "number"
                              },
                              "streak": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "leaderboard": [
                      {
                        "rank": 1,
                        "handle": "anon-1",
                        "xp": 99000,
                        "level": 12,
                        "streak": 30
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB query error on user_rewards"
          }
        }
      }
    },
    "/v1/rewards/levels": {
      "get": {
        "summary": "List level definitions",
        "description": "Returns all reward level definitions with their XP thresholds and names. Static catalog — no user context.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "rewards-levels",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data[] = each level: level (number), xp_required (cumulative XP threshold to reach it), name (level title).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "level": {
                            "type": "number"
                          },
                          "xp_required": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "level": 1,
                      "xp_required": 0,
                      "name": "Rookie"
                    },
                    {
                      "level": 2,
                      "xp_required": 500,
                      "name": "Trader"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error fetching reward levels"
          }
        }
      }
    },
    "/v1/invite/create": {
      "post": {
        "summary": "Create invite code",
        "description": "Creates a new invite/referral code owned by the calling tenant user (resolved from X-User-Ref via the request context). The code, optional label, max_uses (default 1), and optional expiry are persisted under created_by = caller.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data echoes the created code, label, max_uses, expires_at, and created_by (the caller's resolved user id). Errors return HTTP 200 with {\"success\":false,\"error\":\"...\"}: empty code -> 'code is required and cannot be empty'; DB failure -> 'Failed to create invite code:...'; unresolved user -> 'missing user'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "max_uses": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "number"
                        },
                        "created_by": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "code": "ALPHA123",
                    "label": "launch",
                    "max_uses": 1,
                    "expires_at": 1735689600,
                    "created_by": 796611972
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson rejection"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The invite code string to create. Required and must be non-empty."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optional human label for the code."
                  },
                  "max_uses": {
                    "type": "integer",
                    "description": "Max redemptions allowed. Defaults to 1 if omitted."
                  },
                  "expires_at": {
                    "type": "integer",
                    "description": "Optional Unix epoch (seconds) expiry timestamp."
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/invite/list": {
      "get": {
        "summary": "List my invite codes",
        "description": "Lists the CALLER's invite codes with usage stats, scoped to created_by = caller (v0.7.221 fix; previously leaked every code system-wide). Returns each code with label, counts, active flag, and timestamps.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.total is the number of codes returned; data.codes[] each contains code, label, created_by, max_uses, use_count, is_active, expires_at, created_at. Only codes the caller created are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "codes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "created_by": {
                                "type": "number"
                              },
                              "max_uses": {
                                "type": "number"
                              },
                              "use_count": {
                                "type": "number"
                              },
                              "is_active": {
                                "type": "boolean"
                              },
                              "expires_at": {},
                              "created_at": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 1,
                    "codes": [
                      {
                        "code": "ALPHA123",
                        "label": "launch",
                        "created_by": 796611972,
                        "max_uses": 1,
                        "use_count": 0,
                        "is_active": true,
                        "expires_at": null,
                        "created_at": 1735689600
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/invite/use": {
      "post": {
        "summary": "Redeem invite code",
        "description": "Validates and consumes an invite code for the calling user, then marks the user alpha-approved. Validation + consumption is atomic; on success the caller gains alpha access.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-use",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data echoes the redeemed code and alpha_approved:true. The caller's telegram_id is deliberately NOT echoed (v0.7.223 fix #12 — avoids a confirmation oracle). Errors (HTTP 200, success:false): empty code; 'Invalid, expired, or exhausted invite code' when validation fails; 'Code was consumed but failed to approve user:...' if approval fails post-consume; 'missing user'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "alpha_approved": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "code": "ALPHA123",
                    "alpha_approved": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson rejection"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The invite code to redeem. Required and must be non-empty."
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/invite/revoke": {
      "post": {
        "summary": "Revoke invite code",
        "description": "Deactivates one of the CALLER's invite codes, scoped via WHERE created_by = caller (v0.7.221 fix). Non-owners get a generic 'not found or already revoked' message regardless of whether the code exists.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-revoke",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success data.revoked is true. If the code is not owned by the caller or was already revoked, returns HTTP 200 with {\"success\":false,\"error\":\"Invite code not found or already revoked\"}. Other errors: empty code; 'Failed to revoke invite code:...'; 'missing user'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "revoked": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "code": "ALPHA123",
                    "revoked": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "malformed JSON body (ApiJson rejection"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The invite code to revoke. Required and must be non-empty."
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/invite/alpha-users": {
      "get": {
        "summary": "List my codes' alpha redemptions",
        "description": "Lists recent alpha-approved redemptions of the CALLER's invite codes only (SQL JOIN scoped to creator, v0.7.223 fix #5). telegram_id is stripped from every row (PII leak fix); only the redeeming code and timestamp are returned.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-alpha-users",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows to return. Defaults to 20, capped at 500."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.total is the row count; data.users[] each has invited_by_code and created_at only — telegram_id is intentionally omitted. Filtered to redemptions of codes the caller created; LIMIT applies after the ownership filter.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "invited_by_code": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 1,
                    "users": [
                      {
                        "invited_by_code": "ALPHA123",
                        "created_at": 1735689600
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/invite/stats": {
      "get": {
        "summary": "My invite stats",
        "description": "Returns aggregate invite stats scoped to the CALLER's codes only (v0.7.221 fix; previously exposed platform-wide user counts and the full code list). No platform-wide counts are exposed.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.your_codes = total codes the caller created; active_codes = currently active among them; total_code_uses = sum of redemptions across the caller's codes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "your_codes": {
                          "type": "number"
                        },
                        "active_codes": {
                          "type": "number"
                        },
                        "total_code_uses": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "your_codes": 3,
                    "active_codes": 2,
                    "total_code_uses": 7
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/invite/check": {
      "get": {
        "summary": "Check alpha approval",
        "description": "Checks whether the current user is alpha-approved. Resolves the user id from the request extensions (require_user) rather than the tenancy ctx.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "invite-check",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.telegram_id is the caller's resolved user id and alpha_approved is the boolean approval status. Note: unlike the other invite routes, this one DOES echo telegram_id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "telegram_id": {
                          "type": "number"
                        },
                        "alpha_approved": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "telegram_id": 796611972,
                    "alpha_approved": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/tickets/create": {
      "post": {
        "summary": "Create support ticket",
        "description": "Opens a new support ticket for the authenticated tenant user. The active wallet address (if any) is auto-resolved and attached; username is null under API-key auth.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "tickets-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ticket_id is the new ticket's DB id; message echoes the submitted body. User is resolved from the tenancy RequestCtx (X-User-Ref).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "ticket_id": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "ticket_id": 1234,
                  "message": "My swap failed"
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user in request context, or message is empty/whitespace, or DB create_ticket fails"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Ticket body. Must be non-empty (trimmed)."
                  }
                },
                "required": [
                  "message"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/tickets/list": {
      "get": {
        "summary": "List my tickets",
        "description": "Returns the calling user's tickets, most recent first (capped at 10 by the DB layer). Scoped to the authenticated telegram_id; never returns other users' tickets.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "tickets-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "count is the number of returned tickets; each ticket has id, message, status (open/replied/closed), admin_reply, admin_reply_at, created_at.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "tickets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "message": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "admin_reply": {},
                          "admin_reply_at": {},
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "tickets": [
                    {
                      "id": 1234,
                      "message": "My swap failed",
                      "status": "open",
                      "admin_reply": null,
                      "admin_reply_at": null,
                      "created_at": "2026-06-25T12:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user in request context, or DB query fails"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/tickets/stats": {
      "get": {
        "summary": "Ticket counts",
        "description": "Returns the calling user's ticket counts: total plus per-status buckets (open, replied, closed). All counts are scoped to the caller's telegram_id (platform-wide totals were removed in v0.7.251 to prevent cross-tenant volume leakage).",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "tickets-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "stats.total is the caller's total ticket count; open/replied/closed are per-status counts for the same user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "open": {
                          "type": "number"
                        },
                        "replied": {
                          "type": "number"
                        },
                        "closed": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "stats": {
                    "total": 5,
                    "open": 2,
                    "replied": 1,
                    "closed": 2
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user in request context, or a count query fails"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/tickets/{id}": {
      "get": {
        "summary": "Get ticket by id",
        "description": "Fetches a single ticket by id, ownership-enforced at the SQL layer. A request for another user's ticket returns 'Ticket not found' identically to a nonexistent id (no existence leak).",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "tickets-get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Ticket id (i64). Must belong to the calling user."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ticket includes id, telegram_id, username, wallet_address, message, status, admin_reply, admin_reply_at, forwarded_message_id, created_at.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "ticket": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "telegram_id": {
                          "type": "number"
                        },
                        "username": {},
                        "wallet_address": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "admin_reply": {},
                        "admin_reply_at": {},
                        "forwarded_message_id": {},
                        "created_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "ticket": {
                    "id": 1234,
                    "telegram_id": 796611972,
                    "username": null,
                    "wallet_address": "So1111...",
                    "message": "My swap failed",
                    "status": "open",
                    "admin_reply": null,
                    "admin_reply_at": null,
                    "forwarded_message_id": null,
                    "created_at": "2026-06-25T12:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user in request context, ticket not found / not owned by caller, or DB query fails"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/tickets/{id}/close": {
      "post": {
        "summary": "Close ticket",
        "description": "Closes one of the caller's tickets. Ownership is enforced in the WHERE clause; returns 'Ticket not found' for another user's id and 'already closed' if the caller's ticket is already inactive.",
        "tags": [
          "Trading API: Account & Profile"
        ],
        "operationId": "tickets-close",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Ticket id (i64) to close. Must belong to the calling user."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success returns the closed ticket_id and status 'closed'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "ticket_id": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "ticket_id": 1234,
                  "status": "closed"
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "422": {
            "description": "missing user in request context, ticket not found / not owned by caller, ticket already closed, or DB update fails"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "database unavailable"
          }
        }
      }
    },
    "/v1/fees/summary": {
      "get": {
        "summary": "Fee summary",
        "description": "Returns the calling app's total platform fees collected with a buy/sell breakdown and effective fee rate. Scoped per-tenant via api_app_users.app_id (platform-wide totals are not exposed).",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "fees-summary",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.grand_total_lamports/grand_total_sol = total fees collected; total_trade_volume_lamports/sol = summed trade notional; effective_fee_rate_bps = grand_total/volume*10000 (0 if no volume); by_side = array of {side (trade_side: buy/sell), total_lamports, count}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "grand_total_lamports": {
                          "type": "number"
                        },
                        "grand_total_sol": {
                          "type": "number"
                        },
                        "total_trade_volume_lamports": {
                          "type": "number"
                        },
                        "total_trade_volume_sol": {
                          "type": "number"
                        },
                        "effective_fee_rate_bps": {
                          "type": "number"
                        },
                        "by_side": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "side": {
                                "type": "string"
                              },
                              "total_lamports": {
                                "type": "number"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "grand_total_lamports": 1234567,
                    "grand_total_sol": 0.001234567,
                    "total_trade_volume_lamports": 123456789,
                    "total_trade_volume_sol": 0.123456789,
                    "effective_fee_rate_bps": 100,
                    "by_side": [
                      {
                        "side": "buy",
                        "total_lamports": 700000,
                        "count": 12
                      },
                      {
                        "side": "sell",
                        "total_lamports": 534567,
                        "count": 8
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error querying fee_ledger (returned as success:false error envelope"
          }
        }
      }
    },
    "/v1/fees/by-source": {
      "get": {
        "summary": "Fees by source",
        "description": "Returns the calling app's fee revenue broken down by trade source (manual, dca, limit, copy_trade, tg_auto, x_auto, afk, etc.). Scoped to ctx.app_id; the legacy app_id query param is accepted but ignored.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "fees-by-source",
        "parameters": [
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Accepted for backward compat but IGNORED — scope is always the caller's own app_id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.sources = array of {source (trade_source), total_lamports/total_sol (fees), total_trade_lamports/total_trade_sol (trade notional), count}, ordered by total_lamports DESC.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "total_lamports": {
                                "type": "number"
                              },
                              "total_sol": {
                                "type": "number"
                              },
                              "total_trade_lamports": {
                                "type": "number"
                              },
                              "total_trade_sol": {
                                "type": "number"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "sources": [
                      {
                        "source": "manual",
                        "total_lamports": 700000,
                        "total_sol": 0.0007,
                        "total_trade_lamports": 70000000,
                        "total_trade_sol": 0.07,
                        "count": 12
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error querying fee_ledger (returned as success:false error envelope"
          }
        }
      }
    },
    "/v1/fees/hourly": {
      "get": {
        "summary": "Fees hourly",
        "description": "Returns the calling app's fee collection bucketed by hour over a lookback window. Scoped per-tenant via api_app_users.app_id.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "fees-hourly",
        "parameters": [
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Hours to look back (default 24, must be 1–720)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.hours = echoed lookback window; data.data = array of hourly buckets {hour (RFC3339 hour-truncated), total_lamports (fees), count (trades)}, ordered by hour DESC.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "hours": {
                          "type": "number"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "hour": {
                                "type": "string"
                              },
                              "total_lamports": {
                                "type": "number"
                              },
                              "count": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "hours": 24,
                    "data": [
                      {
                        "hour": "2026-06-26T14:00:00+00:00",
                        "total_lamports": 52000,
                        "count": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "hours not in 1–720 (returned as success:false error envelope"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error querying fee_ledger (returned as success:false error envelope"
          }
        }
      }
    },
    "/v1/fees/rates": {
      "get": {
        "summary": "Fee rates",
        "description": "Returns the current platform fee BPS rates per trade source and the treasury wallet, read from server environment config. Not tenant-specific (global server config).",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "fees-rates",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data fields are per-source fee BPS from env (MANUAL_FEE_BPS/DCA_FEE_BPS/LIMIT_FEE_BPS/COPY_TRADE_FEE_BPS/a platform setting/a platform setting default 100; AFK_FEE_BPS default 0) plus treasury = a platform setting pubkey string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "manual_bps": {
                          "type": "number"
                        },
                        "dca_bps": {
                          "type": "number"
                        },
                        "limit_bps": {
                          "type": "number"
                        },
                        "copy_trade_bps": {
                          "type": "number"
                        },
                        "tg_auto_bps": {
                          "type": "number"
                        },
                        "x_auto_bps": {
                          "type": "number"
                        },
                        "afk_bps": {
                          "type": "number"
                        },
                        "treasury": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "manual_bps": 100,
                    "dca_bps": 100,
                    "limit_bps": 100,
                    "copy_trade_bps": 100,
                    "tg_auto_bps": 100,
                    "x_auto_bps": 100,
                    "afk_bps": 0,
                    "treasury": "<treasury-pubkey>"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pnl/positions": {
      "get": {
        "summary": "List open positions (PNL)",
        "description": "Returns all currently open positions for the caller's active wallet, each aggregated from its success trades (total buy/sell amounts, buy/sell counts, average entry price in USD and SOL, total tips). Tenant-scoped: resolves user_id from X-User-Ref to the active wallet_id; returns an empty list if the user has no wallet yet.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "pnl-open-positions",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "positions[] aggregates trades joined on positions where status='open'. total_buys_lamports = sum of buy input_amount; total_sells_lamports = sum of sell output_amount; avg_entry_price_usd/sol are input-amount-weighted buy prices; first_trade_at is position opened_at, last_trade_at is max trade created_at; source is the position open source (swap/copy_trade/sniper/dca/limit). count = length of positions[].",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "total_buys_lamports": {
                            "type": "number"
                          },
                          "total_sells_lamports": {
                            "type": "number"
                          },
                          "buy_count": {
                            "type": "number"
                          },
                          "sell_count": {
                            "type": "number"
                          },
                          "avg_entry_price_usd": {
                            "type": "number"
                          },
                          "avg_entry_price_sol": {
                            "type": "number"
                          },
                          "first_trade_at": {
                            "type": "number"
                          },
                          "last_trade_at": {
                            "type": "number"
                          },
                          "source": {
                            "type": "string"
                          },
                          "total_tips_lamports": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "positions": [
                    {
                      "token_mint": "So111...",
                      "token_name": "Wrapped SOL",
                      "token_symbol": "SOL",
                      "dex_type": "pumpfun",
                      "total_buys_lamports": 1000000,
                      "total_sells_lamports": 0,
                      "buy_count": 1,
                      "sell_count": 0,
                      "avg_entry_price_usd": 0.0001,
                      "avg_entry_price_sol": 1e-7,
                      "first_trade_at": 1719300000,
                      "last_trade_at": 1719300000,
                      "source": "swap",
                      "total_tips_lamports": 50000
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error (code:\"db\""
          }
        }
      }
    },
    "/v1/pnl/position": {
      "get": {
        "summary": "Open position detail (PNL)",
        "description": "Returns the single open position for a given mint on the caller's active wallet, with aggregated trade stats (total buys/sells in lamports, buy/sell counts) plus position metadata. Tenant-scoped via X-User-Ref → active wallet_id.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "pnl-position-detail",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint address (required, non-empty)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "position is null (with success:true) when no open position exists for the mint or the user has no wallet. total_buys_lamports/total_sells_lamports and buy_count/sell_count are computed from get_trades_by_token; remaining fields come from the positions row.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "position": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "wallet_id": {
                          "type": "number"
                        },
                        "token_mint": {
                          "type": "string"
                        },
                        "token_name": {
                          "type": "string"
                        },
                        "token_symbol": {
                          "type": "string"
                        },
                        "dex_type": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "opened_at": {
                          "type": "number"
                        },
                        "first_buy_signature": {
                          "type": "string"
                        },
                        "total_buys_lamports": {
                          "type": "number"
                        },
                        "total_sells_lamports": {
                          "type": "number"
                        },
                        "buy_count": {
                          "type": "number"
                        },
                        "sell_count": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "position": {
                    "id": 42,
                    "wallet_id": 7,
                    "token_mint": "So111...",
                    "token_name": "Wrapped SOL",
                    "token_symbol": "SOL",
                    "dex_type": "pumpfun",
                    "status": "open",
                    "source": "swap",
                    "opened_at": 1719300000,
                    "first_buy_signature": "5xq...",
                    "total_buys_lamports": 1000000,
                    "total_sells_lamports": 0,
                    "buy_count": 1,
                    "sell_count": 0
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "422": {
            "description": "missing or empty ?mint= (code:\"missing_param\""
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error (code:\"db\""
          }
        }
      }
    },
    "/v1/pnl/history": {
      "get": {
        "summary": "Closed position history (realized PNL)",
        "description": "Returns closed positions for the caller's active wallet with realized PNL (SOL lamports + USD, percent returns, costs, proceeds, fees, tips), most recent first. Tenant-scoped via X-User-Ref → active wallet_id.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "pnl-closed-history",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max results, default 50, clamped to 1..200."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "positions[] are ClosedPositionSummary rows. realized_pnl_sol_lamports is realized SOL PnL in lamports; realized_pnl_usd is USD PnL; pnl_sol_percent/pnl_usd_percent are percent returns; total_cost/proceeds/platform_fee/tip are lamports; close_sol_price_usd is the SOL/USD price at close. count = length of positions[]. Ordered by closed_at descending (DB helper).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "position_id": {
                            "type": "number"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "realized_pnl_sol_lamports": {
                            "type": "number"
                          },
                          "realized_pnl_usd": {
                            "type": "number"
                          },
                          "pnl_sol_percent": {
                            "type": "number"
                          },
                          "pnl_usd_percent": {
                            "type": "number"
                          },
                          "total_cost_lamports": {
                            "type": "number"
                          },
                          "total_proceeds_lamports": {
                            "type": "number"
                          },
                          "total_platform_fee_lamports": {
                            "type": "number"
                          },
                          "total_tip_lamports": {
                            "type": "number"
                          },
                          "opened_at": {
                            "type": "number"
                          },
                          "closed_at": {
                            "type": "number"
                          },
                          "close_sol_price_usd": {
                            "type": "number"
                          },
                          "buy_count": {
                            "type": "number"
                          },
                          "sell_count": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "positions": [
                    {
                      "position_id": 42,
                      "token_mint": "So111...",
                      "token_name": "Wrapped SOL",
                      "token_symbol": "SOL",
                      "dex_type": "pumpfun",
                      "source": "swap",
                      "realized_pnl_sol_lamports": 250000,
                      "realized_pnl_usd": 0.04,
                      "pnl_sol_percent": 25,
                      "pnl_usd_percent": 24,
                      "total_cost_lamports": 1000000,
                      "total_proceeds_lamports": 1250000,
                      "total_platform_fee_lamports": 10000,
                      "total_tip_lamports": 50000,
                      "opened_at": 1719300000,
                      "closed_at": 1719400000,
                      "close_sol_price_usd": 160,
                      "buy_count": 1,
                      "sell_count": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "db error (code:\"db\""
          }
        }
      }
    },
    "/v1/positions/list": {
      "get": {
        "summary": "List open positions",
        "description": "Returns all open positions for the authenticated user's active wallet, aggregated from the positions+trades join (total buys/sells in lamports, buy/sell counts, average entry price in USD and SOL, total tips). Tenant-scoped: resolves user_id from the request context and the wallet via the active wallet; if no wallet is found it returns an empty list rather than an error.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "positions-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true, count=number of open positions, positions[] each with token_mint, token_name, token_symbol, dex_type, total_buys_lamports / total_sells_lamports (summed input/output amounts), buy_count/sell_count, avg_entry_price_usd / avg_entry_price_sol (buy-volume-weighted), first_trade_at (position opened_at, unix secs), last_trade_at, source (swap/copy_trade/sniper/dca/limit), total_tips_lamports. Only trades with status='success' contribute to the aggregates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "total_buys_lamports": {
                            "type": "number"
                          },
                          "total_sells_lamports": {
                            "type": "number"
                          },
                          "buy_count": {
                            "type": "number"
                          },
                          "sell_count": {
                            "type": "number"
                          },
                          "avg_entry_price_usd": {
                            "type": "number"
                          },
                          "avg_entry_price_sol": {
                            "type": "number"
                          },
                          "first_trade_at": {
                            "type": "number"
                          },
                          "last_trade_at": {
                            "type": "number"
                          },
                          "source": {
                            "type": "string"
                          },
                          "total_tips_lamports": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "positions": [
                    {
                      "token_mint": "So111...",
                      "token_name": "Token",
                      "token_symbol": "TKN",
                      "dex_type": "pumpfun",
                      "total_buys_lamports": 1000000,
                      "total_sells_lamports": 0,
                      "buy_count": 1,
                      "sell_count": 0,
                      "avg_entry_price_usd": 0.0001,
                      "avg_entry_price_sol": 1e-7,
                      "first_trade_at": 1700000000,
                      "last_trade_at": 1700000000,
                      "source": "swap",
                      "total_tips_lamports": 50000
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "key lacks read scope, or user context cannot be resolved from ctx"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (code=db"
          }
        }
      }
    },
    "/v1/positions/{id}/trades": {
      "get": {
        "summary": "List trades for a position",
        "description": "Returns every trade belonging to a specific position id, ordered oldest-first. Ownership is enforced by joining trades to positions and filtering on the caller's resolved wallet_id, so a position id belonging to another tenant returns an empty trades list. If the caller has no active wallet it returns 404.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "positions-position-trades",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Position id (i32) to fetch trades for. Scoped to the caller's wallet via JOIN."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true, position_id echoes the path param, count=number of trades, trades[] each with id, wallet_id, trade_type (buy/sell), token_mint/name/symbol, dex_type, input_amount, output_amount, price_usd, price_sol, signature, status, buy_mode, position_id, created_at (unix secs), tip_lamports, platform_fee_lamports, sol_price_usd. Ordered created_at ASC.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "position_id": {
                      "type": "number"
                    },
                    "count": {
                      "type": "number"
                    },
                    "trades": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "wallet_id": {
                            "type": "number"
                          },
                          "trade_type": {
                            "type": "string"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "input_amount": {
                            "type": "number"
                          },
                          "output_amount": {
                            "type": "number"
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "price_sol": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "buy_mode": {
                            "type": "string"
                          },
                          "position_id": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "number"
                          },
                          "tip_lamports": {
                            "type": "number"
                          },
                          "platform_fee_lamports": {
                            "type": "number"
                          },
                          "sol_price_usd": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "position_id": 42,
                  "count": 2,
                  "trades": [
                    {
                      "id": 101,
                      "wallet_id": 7,
                      "trade_type": "buy",
                      "token_mint": "So111...",
                      "token_name": "Token",
                      "token_symbol": "TKN",
                      "dex_type": "pumpfun",
                      "input_amount": 1000000,
                      "output_amount": 50000000,
                      "price_usd": 0.0001,
                      "price_sol": 1e-7,
                      "signature": "5x...",
                      "status": "success",
                      "buy_mode": "swap",
                      "position_id": 42,
                      "created_at": 1700000000,
                      "tip_lamports": 50000,
                      "platform_fee_lamports": 10000,
                      "sol_price_usd": 150
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "key lacks read scope, or user context cannot be resolved from ctx"
          },
          "404": {
            "description": "caller has no active wallet (position not found, code=not_found"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (code=db"
          }
        }
      }
    },
    "/v1/positions/pnl-card": {
      "post": {
        "summary": "(Not yet available) Generate PNL card",
        "description": "Intended to render a PNL card PNG, but requires a separate image-rendering service not available in DB-only mode, so it always returns 501.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "positions-pnl-card",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always 501 NOT_IMPLEMENTED. Body is accepted via ApiJson but never processed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "pnl-card requires a PNG rendering service not available in DB-only mode (P3+)"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "always — PNG rendering service unavailable in DB-only mode"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "object",
                    "description": "Arbitrary JSON body (accepted but ignored; the handler returns 501 before reading it)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/positions/trades": {
      "get": {
        "summary": "List trades by token mint",
        "description": "Returns all trades for a given token mint across the caller's active wallet (via db.get_trades_by_token). The ?mint= query parameter is required. If the caller has no active wallet it returns an empty trades list rather than an error.",
        "tags": [
          "Trading API: Fees, PnL & Positions"
        ],
        "operationId": "positions-trades-by-mint",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint address to filter trades by. Required and must be non-empty."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true, mint echoes the query param, count=number of trades, trades[] same per-trade shape as positions/{id}/trades (id, wallet_id, trade_type, token_mint/name/symbol, dex_type, input_amount, output_amount, price_usd, price_sol, signature, status, buy_mode, position_id, created_at, tip_lamports, platform_fee_lamports, sol_price_usd).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "mint": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "trades": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "wallet_id": {
                            "type": "number"
                          },
                          "trade_type": {
                            "type": "string"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "input_amount": {
                            "type": "number"
                          },
                          "output_amount": {
                            "type": "number"
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "price_sol": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "buy_mode": {
                            "type": "string"
                          },
                          "position_id": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "number"
                          },
                          "tip_lamports": {
                            "type": "number"
                          },
                          "platform_fee_lamports": {
                            "type": "number"
                          },
                          "sol_price_usd": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "mint": "So111...",
                  "count": 1,
                  "trades": [
                    {
                      "id": 101,
                      "wallet_id": 7,
                      "trade_type": "sell",
                      "token_mint": "So111...",
                      "token_name": "Token",
                      "token_symbol": "TKN",
                      "dex_type": "pumpfun",
                      "input_amount": 50000000,
                      "output_amount": 1100000,
                      "price_usd": 0.00011,
                      "price_sol": 1.1e-7,
                      "signature": "5x...",
                      "status": "success",
                      "buy_mode": "swap",
                      "position_id": 42,
                      "created_at": 1700000000,
                      "tip_lamports": 50000,
                      "platform_fee_lamports": 10000,
                      "sol_price_usd": 150
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key (require_app"
          },
          "403": {
            "description": "key lacks read scope, or user context cannot be resolved from ctx"
          },
          "422": {
            "description": "?mint= query parameter missing or empty (code=missing_param"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "database error (code=db"
          }
        }
      }
    },
    "/v1/indexer/token": {
      "get": {
        "summary": "Get indexed token metadata",
        "description": "Looks up a single token in the in-process indexer by mint and returns its on-chain metadata (name/symbol/decimals/token_program/uri/supply/creator/source). Read-only the database query against the indexer's 460K+ token cache.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-token",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint address to look up"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is the full token row, or null when the mint isn't indexed. success:true even on a miss (data:null).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "mint": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "decimals": {
                          "type": "number"
                        },
                        "token_program": {
                          "type": "string"
                        },
                        "uri": {
                          "type": "string"
                        },
                        "total_supply": {
                          "type": "number"
                        },
                        "creator": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "indexed_at": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "mint": "So111...",
                    "name": "Token",
                    "symbol": "TKN",
                    "decimals": 6,
                    "token_program": "TokenkegQ...",
                    "uri": "https://...",
                    "total_supply": 1000000000,
                    "creator": "5xyz...",
                    "source": "pumpfun",
                    "indexed_at": 1719331200
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing mint param (returns success:false code=indexer_error in 200 body"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/pool": {
      "get": {
        "summary": "Get indexed pool by mint",
        "description": "Returns the latest indexed pool for a mint, or a specific DEX's pool when dex_type is supplied (synonyms normalized). Carries pool_address, vaults, token programs, raw dex_data, creator and launch slot/signature/block_time for fast pool-param lookups.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-pool",
        "parameters": [
          {
            "name": "mint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token mint address"
          },
          {
            "name": "dex_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional DEX filter (canonical or synonym, e.g. pumpfun/pump, raydium_cpmm/raycpmm, orca/whirlpool). When omitted, returns the most recently indexed pool for the mint."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is a full pool row or null when no pool is indexed for the mint. dex_data is a JSON string of DEX-specific layout fields.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "pool_address": {
                          "type": "string"
                        },
                        "dex_type": {
                          "type": "string"
                        },
                        "base_mint": {
                          "type": "string"
                        },
                        "quote_mint": {
                          "type": "string"
                        },
                        "base_vault": {
                          "type": "string"
                        },
                        "quote_vault": {
                          "type": "string"
                        },
                        "base_token_program": {
                          "type": "string"
                        },
                        "quote_token_program": {
                          "type": "string"
                        },
                        "dex_data": {
                          "type": "string"
                        },
                        "creator": {
                          "type": "string"
                        },
                        "slot": {
                          "type": "number"
                        },
                        "signature": {
                          "type": "string"
                        },
                        "block_time": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 123,
                    "pool_address": "7pool...",
                    "dex_type": "pumpswap",
                    "base_mint": "5mint...",
                    "quote_mint": "So111...",
                    "base_vault": "Bvlt...",
                    "quote_vault": "Qvlt...",
                    "base_token_program": "Tokenkeg...",
                    "quote_token_program": "Tokenkeg...",
                    "dex_data": "{...}",
                    "creator": "5xyz...",
                    "slot": 271234567,
                    "signature": "3sig...",
                    "block_time": 1719331200
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing mint param (success:false code=indexer_error in 200 body"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/pool-by-address": {
      "get": {
        "summary": "Get indexed pool by address",
        "description": "Looks up a single indexed pool directly by its on-chain pool/pair address and returns the same pool row shape as /indexer/pool.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-pool-by-address",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Pool/pair on-chain address"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is the pool row or null when the address isn't indexed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "pool_address": {
                          "type": "string"
                        },
                        "dex_type": {
                          "type": "string"
                        },
                        "base_mint": {
                          "type": "string"
                        },
                        "quote_mint": {
                          "type": "string"
                        },
                        "base_vault": {
                          "type": "string"
                        },
                        "quote_vault": {
                          "type": "string"
                        },
                        "base_token_program": {
                          "type": "string"
                        },
                        "quote_token_program": {
                          "type": "string"
                        },
                        "dex_data": {
                          "type": "string"
                        },
                        "creator": {
                          "type": "string"
                        },
                        "slot": {
                          "type": "number"
                        },
                        "signature": {
                          "type": "string"
                        },
                        "block_time": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 123,
                    "pool_address": "7pool...",
                    "dex_type": "raydium_cpmm",
                    "base_mint": "5mint...",
                    "quote_mint": "So111...",
                    "base_vault": "Bvlt...",
                    "quote_vault": "Qvlt...",
                    "base_token_program": "Tokenkeg...",
                    "quote_token_program": "Tokenkeg...",
                    "dex_data": "{...}",
                    "creator": "5xyz...",
                    "slot": 271234567,
                    "signature": "3sig...",
                    "block_time": 1719331200
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing address param (success:false code=indexer_error in 200 body"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/recent-tokens": {
      "get": {
        "summary": "List recent indexed tokens",
        "description": "Returns the most recently indexed tokens, optionally filtered to one DEX. Sorted by indexed_at DESC. Returns lightweight token metadata rows (no price/metrics).",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-recent-tokens",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows, default 20, clamped to 1..200"
          },
          {
            "name": "dex_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional DEX filter (canonical or synonym). When omitted, returns recent tokens across all DEXes."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is an array of token rows (TokenResponse). Empty array when none match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "token_program": {
                            "type": "string"
                          },
                          "uri": {
                            "type": "string"
                          },
                          "total_supply": {
                            "type": "number"
                          },
                          "creator": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "indexed_at": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "mint": "5mint...",
                      "name": "Token",
                      "symbol": "TKN",
                      "decimals": 6,
                      "token_program": "Tokenkeg...",
                      "uri": "https://...",
                      "total_supply": 1000000000,
                      "creator": "5xyz...",
                      "source": "pumpfun",
                      "indexed_at": 1719331200
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/recent-by-dex": {
      "get": {
        "summary": "Recent tokens grouped by DEX (metrics-enriched)",
        "description": "Returns the most recent tokens for every supported DEX in one call, grouped by DEX name, each enriched with token_metrics (price/mcap/liquidity/rolling-window volume + swap counts) and resolved off-chain metadata (image/socials/description). USD values computed server-side from the cached SOL/USD price.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-recent-by-dex",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows per DEX, default 5, clamped to 1..50"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is a map: sol_usd (the SOL/USD price used for conversions) plus one key per DEX (only DEXes with rows are included) whose value is an array of metrics-enriched token rows. price_sol falls back to creation reserves when no live swap price exists; mcap derived from price x circulating supply when the aggregator value is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "sol_usd": {
                          "type": "number"
                        },
                        "pumpfun": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mint": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "decimals": {
                                "type": "number"
                              },
                              "token_program": {
                                "type": "string"
                              },
                              "uri": {
                                "type": "string"
                              },
                              "total_supply": {
                                "type": "number"
                              },
                              "creator": {
                                "type": "string"
                              },
                              "pool_address": {
                                "type": "string"
                              },
                              "quote_mint": {
                                "type": "string"
                              },
                              "dex_type": {
                                "type": "string"
                              },
                              "indexed_at": {
                                "type": "number"
                              },
                              "image_url": {
                                "type": "string"
                              },
                              "twitter_url": {},
                              "website_url": {},
                              "telegram_url": {},
                              "description": {},
                              "price_sol": {
                                "type": "number"
                              },
                              "price_usd": {
                                "type": "number"
                              },
                              "liquidity_sol": {
                                "type": "number"
                              },
                              "liquidity_usd": {
                                "type": "number"
                              },
                              "mcap_sol": {
                                "type": "number"
                              },
                              "mcap_usd": {
                                "type": "number"
                              },
                              "volume_5m_usd": {
                                "type": "number"
                              },
                              "volume_1h_usd": {
                                "type": "number"
                              },
                              "volume_6h_usd": {
                                "type": "number"
                              },
                              "volume_24h_usd": {
                                "type": "number"
                              },
                              "swaps_5m": {
                                "type": "number"
                              },
                              "swaps_1h": {
                                "type": "number"
                              },
                              "swaps_6h": {
                                "type": "number"
                              },
                              "swaps_24h": {
                                "type": "number"
                              },
                              "last_swap_at": {}
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "sol_usd": 152.3,
                    "pumpfun": [
                      {
                        "mint": "5mint...",
                        "name": "Token",
                        "symbol": "TKN",
                        "decimals": 6,
                        "token_program": "Tokenkeg...",
                        "uri": "https://...",
                        "total_supply": 1000000000,
                        "creator": "5xyz...",
                        "pool_address": "7pool...",
                        "quote_mint": "So111...",
                        "dex_type": "pumpfun",
                        "indexed_at": 1719331200,
                        "image_url": "https://...",
                        "twitter_url": null,
                        "website_url": null,
                        "telegram_url": null,
                        "description": null,
                        "price_sol": 1e-7,
                        "price_usd": 0.0000152,
                        "liquidity_sol": 30,
                        "liquidity_usd": 4569,
                        "mcap_sol": 100,
                        "mcap_usd": 15230,
                        "volume_5m_usd": 0,
                        "volume_1h_usd": 0,
                        "volume_6h_usd": 0,
                        "volume_24h_usd": 0,
                        "swaps_5m": 0,
                        "swaps_1h": 0,
                        "swaps_6h": 0,
                        "swaps_24h": 0,
                        "last_swap_at": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/recent-pools": {
      "get": {
        "summary": "List recent pool launches",
        "description": "Pool launches sorted by indexer insertion time (DESC), LEFT JOIN'd with indexed_tokens so name/symbol/uri are included once enrichment lands. Each row has a launch tx signature to deep-link to Solscan. Optional DEX filter validated against the canonical allow-list.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-recent-pools",
        "parameters": [
          {
            "name": "dex_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional DEX filter (canonical or synonym; validated against the allow-list). When omitted, returns launches across all DEXes."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows (default 50; not clamped here, passed to the query)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is an array of RecentPoolResponse. name/symbol/uri are nullable (LEFT JOIN — null until token enrichment catches up). block_time may be null on the first batch after a fresh restart; indexed_at is always populated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "pool_address": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "block_time": {
                            "type": "number"
                          },
                          "indexed_at": {
                            "type": "number"
                          },
                          "creator": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "uri": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "mint": "5mint...",
                      "pool_address": "7pool...",
                      "dex_type": "pumpfun",
                      "signature": "3sig...",
                      "block_time": 1719331200,
                      "indexed_at": 1719331205,
                      "creator": "5xyz...",
                      "name": "Token",
                      "symbol": "TKN",
                      "uri": "https://..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "unknown dex_type (success:false code=indexer_error 'Unknown dex_type: X' in 200 body"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/search": {
      "get": {
        "summary": "Search tokens",
        "description": "Case-insensitive LIKE search over indexed tokens by name/symbol/mint, returning DB-metric-enriched results (price_sol, volume_24h_usd, liquidity_usd, mcap_usd) sorted by the chosen key. USD values computed from the cached SOL/USD price.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search query (alias: query). Required and non-empty."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort key, default 'mc' (market cap)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows, default 10, capped at 50"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Includes a top-level count plus data array. Metrics are DB-only (no live SwapAggregator enrichment in this state); callers needing rolling-window stats should use /indexer/stats or the test-api. LIKE special chars in q are escaped server-side.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "mint": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "pool_address": {
                            "type": "string"
                          },
                          "block_time": {
                            "type": "number"
                          },
                          "price_sol": {
                            "type": "number"
                          },
                          "volume_24h_usd": {
                            "type": "number"
                          },
                          "liquidity_usd": {
                            "type": "number"
                          },
                          "mcap_usd": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "data": [
                    {
                      "mint": "5mint...",
                      "name": "Token",
                      "symbol": "TKN",
                      "decimals": 6,
                      "dex_type": "pumpfun",
                      "pool_address": "7pool...",
                      "block_time": 1719331200,
                      "price_sol": 1e-7,
                      "volume_24h_usd": 1234.5,
                      "liquidity_usd": 4569,
                      "mcap_usd": 15230
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "missing/empty q param (success:false code=indexer_error in 200 body"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/stats": {
      "get": {
        "summary": "Indexer statistics",
        "description": "Returns aggregate indexer counters: total/enriched/pending/failed pools, total tokens, and a per-DEX pool-count breakdown.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data carries the four pool-state counters, total_tokens, and pools_per_dex (a map of canonical DEX name to pool count).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total_pools": {
                          "type": "number"
                        },
                        "enriched_pools": {
                          "type": "number"
                        },
                        "pending_pools": {
                          "type": "number"
                        },
                        "failed_pools": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "type": "number"
                        },
                        "pools_per_dex": {
                          "type": "object",
                          "properties": {
                            "pumpfun": {
                              "type": "number"
                            },
                            "pumpswap": {
                              "type": "number"
                            },
                            "raydium_cpmm": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total_pools": 460123,
                    "enriched_pools": 455000,
                    "pending_pools": 5000,
                    "failed_pools": 123,
                    "total_tokens": 461000,
                    "pools_per_dex": {
                      "pumpfun": 300000,
                      "pumpswap": 80000,
                      "raydium_cpmm": 40000
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        }
      }
    },
    "/v1/indexer/tokens/batch": {
      "post": {
        "summary": "Batch token lookup",
        "description": "Enriches up to 100 mints in one round-trip, returning a map of mint to its full token row. Mints not found are omitted from the map (not null-valued) so callers can detect coverage gaps cheaply.",
        "tags": [
          "Trading API: Indexer"
        ],
        "operationId": "indexer-tokens-batch",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data is a map keyed by mint to the full token row (TokenResponse). Mints not indexed are absent from the map. Empty mints array yields data:{}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "5mint...": {
                          "type": "object",
                          "properties": {
                            "mint": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "decimals": {
                              "type": "number"
                            },
                            "token_program": {
                              "type": "string"
                            },
                            "uri": {
                              "type": "string"
                            },
                            "total_supply": {
                              "type": "number"
                            },
                            "creator": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string"
                            },
                            "indexed_at": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "5mint...": {
                      "mint": "5mint...",
                      "name": "Token",
                      "symbol": "TKN",
                      "decimals": 6,
                      "token_program": "Tokenkeg...",
                      "uri": "https://...",
                      "total_supply": 1000000000,
                      "creator": "5xyz...",
                      "source": "pumpfun",
                      "indexed_at": 1719331200
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": ">100 mints (success:false code=indexer_error 'Too many mints' in 200 body); malformed JSON body returns ApiJson error envelope"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "indexer not configured (code=indexer_unavailable in body"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Token mint addresses to look up (max 100). Empty array returns an empty map."
                  }
                },
                "required": [
                  "mints"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/limit/create": {
      "post": {
        "summary": "Create limit order",
        "description": "Creates a limit/conditional order row in the limit_orders table for the calling tenant's active wallet (price/schedule/event trigger, buy or sell). DB-only write; no on-chain action — execution is handled later by the bot's PriceMonitor service. Scoped to the user resolved from the API key + X-User-Ref.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true with the full created order object (from order_to_json). order.id is the new order id; status starts 'pending'; amount_sol is derived from amount_lamports. If the row can't be re-read, order collapses to just {\"id\":<n>}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "token_mint": {
                          "type": "string"
                        },
                        "token_name": {},
                        "token_symbol": {},
                        "dex_type": {
                          "type": "string"
                        },
                        "pair_address": {},
                        "trigger_type": {
                          "type": "string"
                        },
                        "trigger_price_usd": {
                          "type": "number"
                        },
                        "trigger_direction": {
                          "type": "string"
                        },
                        "trigger_at": {},
                        "event_type": {},
                        "price_at_creation": {},
                        "side": {
                          "type": "string"
                        },
                        "amount_lamports": {
                          "type": "number"
                        },
                        "amount_sol": {
                          "type": "number"
                        },
                        "sell_percent": {},
                        "slippage_bps": {
                          "type": "number"
                        },
                        "mev_protect": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "triggered_at": {},
                        "executed_at": {},
                        "execution_signature": {},
                        "error_message": {}
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "order": {
                    "id": 42,
                    "token_mint": "So111...",
                    "token_name": null,
                    "token_symbol": null,
                    "dex_type": "Auto",
                    "pair_address": null,
                    "trigger_type": "price",
                    "trigger_price_usd": 0.05,
                    "trigger_direction": "above",
                    "trigger_at": null,
                    "event_type": null,
                    "price_at_creation": null,
                    "side": "buy",
                    "amount_lamports": 1000000,
                    "amount_sol": 0.001,
                    "sell_percent": null,
                    "slippage_bps": 1000,
                    "mev_protect": true,
                    "status": "pending",
                    "created_at": "2026-06-25T12:00:00+00:00",
                    "expires_at": "2026-06-26T12:00:00+00:00",
                    "triggered_at": null,
                    "executed_at": null,
                    "execution_signature": null,
                    "error_message": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "422": {
            "description": "amount_sol omitted (code 'missing_field'), no active wallet for user (code 'no_wallet'), or malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "DB error creating/reading the order (code 'db'"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint address."
                  },
                  "amount_sol": {
                    "type": "number",
                    "description": "Order size in SOL (converted to lamports). Required — 422 if omitted."
                  },
                  "trigger_type": {
                    "type": "string",
                    "description": "One of price | schedule | event. Default 'price'."
                  },
                  "trigger_price_usd": {
                    "type": "number",
                    "description": "Target USD price for price triggers (stored as 0.0 if omitted)."
                  },
                  "trigger_time_seconds": {
                    "type": "integer",
                    "description": "For trigger_type=schedule: seconds from now until trigger_at."
                  },
                  "event_type": {
                    "type": "string",
                    "description": "For trigger_type=event: event name (e.g. 'migration'). Stored as trigger_direction 'event:<event_type>'. Defaults to 'migration'."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in bps. Default 1000."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via MEV-protected providers. Default true."
                  },
                  "expiry_seconds": {
                    "type": "integer",
                    "description": "Seconds until the order expires. Default 86400 (24h)."
                  },
                  "side": {
                    "type": "string",
                    "description": "buy | sell. Default 'buy'. Determines trigger_direction (sell=below, buy=above) for price triggers."
                  },
                  "sell_percent": {
                    "type": "integer",
                    "description": "For sell orders: percent of holdings to sell."
                  },
                  "trailing_pct": {
                    "type": "number",
                    "description": "Trailing stop percentage (optional)."
                  },
                  "max_retries": {
                    "type": "integer",
                    "description": "Max execution retries. Default 0."
                  }
                },
                "required": [
                  "mint",
                  "amount_sol"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/limit/list": {
      "get": {
        "summary": "List pending limit orders",
        "description": "Returns all pending limit orders for the calling tenant's user. Read from the limit_orders table, scoped to the resolved user id.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "count = number of pending orders; orders is an array of the same order object shape as /limit/create. Only status='pending' orders are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "orders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "trigger_type": {
                            "type": "string"
                          },
                          "trigger_price_usd": {
                            "type": "number"
                          },
                          "trigger_direction": {
                            "type": "string"
                          },
                          "side": {
                            "type": "string"
                          },
                          "amount_lamports": {
                            "type": "number"
                          },
                          "amount_sol": {
                            "type": "number"
                          },
                          "slippage_bps": {
                            "type": "number"
                          },
                          "mev_protect": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "expires_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "orders": [
                    {
                      "id": 42,
                      "token_mint": "So111...",
                      "trigger_type": "price",
                      "trigger_price_usd": 0.05,
                      "trigger_direction": "above",
                      "side": "buy",
                      "amount_lamports": 1000000,
                      "amount_sol": 0.001,
                      "slippage_bps": 1000,
                      "mev_protect": true,
                      "status": "pending",
                      "created_at": "2026-06-25T12:00:00+00:00",
                      "expires_at": "2026-06-26T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/limit/monitor": {
      "get": {
        "summary": "(Not yet available) Limit monitor status",
        "description": "Intended to report PriceMonitor execution status. Not yet wired in the multi-tenant API — returns 501.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-monitor",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always 501 — the price-monitor/trading-executor service is not available in this API process.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "limit order execution requires trading executor"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "always — execution requires the trading executor"
          }
        }
      }
    },
    "/v1/limit/all": {
      "delete": {
        "summary": "Cancel all limit orders",
        "description": "Cancels every pending limit order for the calling tenant's user. Scoped to the resolved user id.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-cancel-all",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "cancelled = number of orders that were cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "cancelled": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "cancelled": 3
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/limit/{id}": {
      "get": {
        "summary": "Get limit order",
        "description": "Fetches a single limit order by id, scoped to the calling tenant's user (cross-user access blocked by user_id filter).",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-get-order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Limit order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true with the full order object (order_to_json). If not found/owned, success=false with error 'Order not found' (HTTP 200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "token_mint": {
                          "type": "string"
                        },
                        "trigger_type": {
                          "type": "string"
                        },
                        "trigger_price_usd": {
                          "type": "number"
                        },
                        "side": {
                          "type": "string"
                        },
                        "amount_lamports": {
                          "type": "number"
                        },
                        "amount_sol": {
                          "type": "number"
                        },
                        "status": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "order": {
                    "id": 42,
                    "token_mint": "So111...",
                    "trigger_type": "price",
                    "trigger_price_usd": 0.05,
                    "side": "buy",
                    "amount_lamports": 1000000,
                    "amount_sol": 0.001,
                    "status": "pending",
                    "created_at": "2026-06-25T12:00:00+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "delete": {
        "summary": "Cancel limit order",
        "description": "Cancels a single pending limit order by id, scoped to the calling tenant's user. Idempotent per order (cancelling an already-cancelled/unknown order returns success=false).",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "limit-cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Limit order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success=true with a confirmation message when cancelled. If the order isn't found/owned or was already cancelled, success=false with error 'Order not found or already cancelled' (HTTP 200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Order #42 cancelled"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "API key lacks 'automation' scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/dca/create": {
      "post": {
        "summary": "(Not yet available) Create DCA order",
        "description": "Intended to create a recurring dollar-cost-average buy/sell order for the authenticated tenant. Currently a 501 stub: it requires rpc/indexer resources that are not yet wired into V1State (P1 Group C), so it always returns NOT_IMPLEMENTED.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns 501 NOT_IMPLEMENTED. Once wired it will create a dca_orders row scoped to the authenticated tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "DCA creation requires rpc/indexer which are not yet wired to V1State (P1 Group C)"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "invalid/missing body fields (e.g. missing mint or interval_seconds"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "always — handler is a stub pending rpc/indexer wiring"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint address to DCA into/out of."
                  },
                  "amount_sol": {
                    "type": "number",
                    "description": "SOL amount per interval (buy side)."
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "description": "Seconds between each DCA execution."
                  },
                  "total_orders": {
                    "type": "integer",
                    "description": "Total number of orders to execute before the schedule completes."
                  },
                  "min_price": {
                    "type": "number",
                    "description": "Lower price guard (USD); skip execution below this."
                  },
                  "max_price": {
                    "type": "number",
                    "description": "Upper price guard (USD); skip execution above this."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Slippage tolerance in basis points. Default 1000."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route via MEV-protected providers. Default true."
                  },
                  "duration_seconds": {
                    "type": "integer",
                    "description": "Overall lifetime of the schedule in seconds before it expires."
                  },
                  "side": {
                    "type": "string",
                    "description": "DCA direction: 'buy' or 'sell'. Default 'buy'."
                  },
                  "sell_percent": {
                    "type": "integer",
                    "description": "Percent of holdings to sell each interval (sell side)."
                  }
                },
                "required": [
                  "mint",
                  "interval_seconds"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/dca/list": {
      "get": {
        "summary": "List DCA orders",
        "description": "Returns all active and paused DCA orders for the authenticated tenant (resolved from X-User-Ref via the tenancy layer). Active orders are listed first, then paused.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-list",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "count = number of orders returned (active + paused combined). Each order: amount_lamports/amount_sol = per-interval size; orders_executed/total_orders = progress; total_sol_spent (lamports) and total_sol_spent_display (SOL) = cumulative spend; total_tokens_bought = cumulative tokens acquired; status is 'active' or 'paused'; timestamps are RFC3339 (nullable).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "orders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_name": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "pair_address": {
                            "type": "string"
                          },
                          "amount_lamports": {
                            "type": "number"
                          },
                          "amount_sol": {
                            "type": "number"
                          },
                          "interval_seconds": {
                            "type": "number"
                          },
                          "total_orders": {
                            "type": "number"
                          },
                          "orders_executed": {
                            "type": "number"
                          },
                          "min_price_usd": {},
                          "max_price_usd": {},
                          "slippage_bps": {
                            "type": "number"
                          },
                          "mev_protect": {
                            "type": "boolean"
                          },
                          "notifications_enabled": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "next_execution_at": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "last_executed_at": {
                            "type": "string"
                          },
                          "duration_seconds": {},
                          "expires_at": {},
                          "total_sol_spent": {
                            "type": "number"
                          },
                          "total_sol_spent_display": {
                            "type": "number"
                          },
                          "total_tokens_bought": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "orders": [
                    {
                      "id": 42,
                      "token_mint": "So111...",
                      "token_name": "Foo",
                      "token_symbol": "FOO",
                      "dex_type": "pumpfun",
                      "pair_address": "...",
                      "amount_lamports": 1000000,
                      "amount_sol": 0.001,
                      "interval_seconds": 3600,
                      "total_orders": 10,
                      "orders_executed": 2,
                      "min_price_usd": null,
                      "max_price_usd": null,
                      "slippage_bps": 1000,
                      "mev_protect": true,
                      "notifications_enabled": true,
                      "status": "active",
                      "next_execution_at": "2026-06-26T12:00:00+00:00",
                      "created_at": "2026-06-26T10:00:00+00:00",
                      "last_executed_at": "2026-06-26T11:00:00+00:00",
                      "duration_seconds": null,
                      "expires_at": null,
                      "total_sol_spent": 2000000,
                      "total_sol_spent_display": 0.002,
                      "total_tokens_bought": 12345
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user (require_user fails"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/dca/{id}": {
      "get": {
        "summary": "Get DCA order",
        "description": "Returns a single DCA order by id, scoped to the authenticated tenant (dca_get_by_id filters by user). Returns success:false with 'Order not found' if it does not exist or belongs to another tenant.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-get-order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "DCA order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "order is the full order_to_json shape (same fields as /v1/dca/list elements). On miss returns {\"success\":false,\"error\":\"Order not found\"} with HTTP 200; on DB failure {\"success\":false,\"error\":\"DB error:...\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "token_mint": {
                          "type": "string"
                        },
                        "token_symbol": {
                          "type": "string"
                        },
                        "dex_type": {
                          "type": "string"
                        },
                        "amount_lamports": {
                          "type": "number"
                        },
                        "amount_sol": {
                          "type": "number"
                        },
                        "interval_seconds": {
                          "type": "number"
                        },
                        "total_orders": {
                          "type": "number"
                        },
                        "orders_executed": {
                          "type": "number"
                        },
                        "slippage_bps": {
                          "type": "number"
                        },
                        "mev_protect": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": "string"
                        },
                        "next_execution_at": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "total_sol_spent": {
                          "type": "number"
                        },
                        "total_sol_spent_display": {
                          "type": "number"
                        },
                        "total_tokens_bought": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "order": {
                    "id": 42,
                    "token_mint": "So111...",
                    "token_symbol": "FOO",
                    "dex_type": "pumpfun",
                    "amount_lamports": 1000000,
                    "amount_sol": 0.001,
                    "interval_seconds": 3600,
                    "total_orders": 10,
                    "orders_executed": 2,
                    "slippage_bps": 1000,
                    "mev_protect": true,
                    "status": "active",
                    "next_execution_at": "2026-06-26T12:00:00+00:00",
                    "created_at": "2026-06-26T10:00:00+00:00",
                    "total_sol_spent": 2000000,
                    "total_sol_spent_display": 0.002,
                    "total_tokens_bought": 12345
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "delete": {
        "summary": "Cancel DCA order",
        "description": "Cancels a single DCA order owned by the authenticated tenant (dca_cancel filters by user). Idempotent at the data level — already-cancelled orders return not-found.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "DCA order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success:true with a message when an active/paused order is cancelled. {\"success\":false,\"error\":\"Order not found or already cancelled\"} if no matching order; {\"success\":false,\"error\":\"Failed to cancel:...\"} on DB error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "DCA #42 cancelled"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/dca/{id}/pause": {
      "post": {
        "summary": "Pause DCA order",
        "description": "Pauses an active DCA order owned by the authenticated tenant (dca_pause filters by user). No further executions occur until resumed.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-pause",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "DCA order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success:true with a message when the order transitions active→paused. {\"success\":false,\"error\":\"Order not found or not active\"} if no matching active order; {\"success\":false,\"error\":\"Failed to pause:...\"} on DB error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "DCA #42 paused"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/dca/{id}/resume": {
      "post": {
        "summary": "Resume DCA order",
        "description": "Resumes a paused DCA order owned by the authenticated tenant (dca_resume filters by user). Re-enables scheduled executions.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-resume",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "DCA order id (i64)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success:true with a message when the order transitions paused→active. {\"success\":false,\"error\":\"Order not found or not paused\"} if no matching paused order; {\"success\":false,\"error\":\"Failed to resume:...\"} on DB error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "DCA #42 resumed"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/dca/all": {
      "delete": {
        "summary": "Cancel all DCA orders",
        "description": "Cancels every DCA order for the authenticated tenant (dca_cancel_all scoped by user) and returns how many were cancelled.",
        "tags": [
          "Trading API: Limit Orders & DCA"
        ],
        "operationId": "dca-cancel-all",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "cancelled = number of orders cancelled for this tenant (0 if none). {\"success\":false,\"error\":\"Failed to cancel:...\"} on DB error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "cancelled": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "cancelled": 3
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key or unresolved user"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/start": {
      "post": {
        "summary": "(Not yet available) Start copy-trade service",
        "description": "Intended to start the live copy-trading engine for the caller. Currently a 501 stub — the copy-trade runtime service is not wired into V1State in this deployment.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-start",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/copy-trade/stop": {
      "post": {
        "summary": "(Not yet available) Stop copy-trade service",
        "description": "Intended to stop the live copy-trading engine for the caller. Currently a 501 stub — the copy-trade runtime service is not wired into V1State.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-stop",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/copy-trade/status": {
      "get": {
        "summary": "(Not yet available) Copy-trade service status (caller)",
        "description": "Intended to report the caller's copy-trade engine status. Currently a 501 stub — requires the live copy-trade service not wired into V1State.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-status",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/copy-trade/system-status": {
      "get": {
        "summary": "(Not yet available) Copy-trade system status",
        "description": "Intended to report global copy-trade engine/system health. Currently a 501 stub — requires the live copy-trade service not wired into V1State.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-system-status",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/copy-trade/add-source": {
      "post": {
        "summary": "(Not yet available) Add copy-trade source wallet",
        "description": "Intended to register a source wallet to follow. Currently a 501 stub — requires the live copy-trade service not wired into V1State; the body is accepted but ignored.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-add-source",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope; body is parsed (ApiJson) but never used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "integer",
                    "description": "Source id to attach."
                  },
                  "wallet_address": {
                    "type": "string",
                    "description": "Solana wallet address of the source to follow."
                  }
                },
                "required": [
                  "source_id",
                  "wallet_address"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/remove-source": {
      "post": {
        "summary": "(Not yet available) Remove copy-trade source wallet",
        "description": "Intended to unregister a source wallet. Currently a 501 stub — requires the live copy-trade service not wired into V1State; the body is accepted but ignored.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-remove-source",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope; body is parsed (ApiJson) but never used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "integer",
                    "description": "Source id to remove."
                  }
                },
                "required": [
                  "source_id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/create-config": {
      "post": {
        "summary": "Create copy-trade config",
        "description": "Creates a new copy-trade config for the caller's active wallet following the given source wallet, then activates it. Scoped to the X-User-Ref tenant; uses BuyMode::Fixed with buy_amount_sol.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-create-config",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the new config_id and the resolved source_id. Config is created, activated (ct_toggle_config true), optional observe_only set, and the source row get-or-created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "source_id": {
                      "type": "number"
                    },
                    "source_wallet": {
                      "type": "string"
                    },
                    "buy_amount_sol": {
                      "type": "number"
                    },
                    "buy_slippage_bps": {
                      "type": "number"
                    },
                    "sell_slippage_bps": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 123,
                  "source_id": 45,
                  "source_wallet": "So111...",
                  "buy_amount_sol": 0.5,
                  "buy_slippage_bps": 1000,
                  "sell_slippage_bps": 1000,
                  "message": "Config created and activated."
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_wallet": {
                    "type": "string",
                    "description": "Solana pubkey of the wallet to copy."
                  },
                  "buy_amount_sol": {
                    "type": "number",
                    "description": "Fixed SOL amount per copied buy. Must be between 0.001 and 100."
                  },
                  "buy_slippage_bps": {
                    "type": "integer",
                    "description": "Buy slippage in bps. Defaults to 1000 (10%)."
                  },
                  "sell_slippage_bps": {
                    "type": "integer",
                    "description": "Sell slippage in bps. Defaults to 1000 (10%)."
                  },
                  "name": {
                    "type": "string",
                    "description": "Config label. Defaults to 'API Config'."
                  },
                  "observe_only": {
                    "type": "boolean",
                    "description": "If true, config observes/logs without executing trades. Defaults to false."
                  }
                },
                "required": [
                  "source_wallet",
                  "buy_amount_sol"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/delete-config": {
      "post": {
        "summary": "Delete copy-trade config",
        "description": "Deletes one of the caller's copy-trade configs by id. Ownership-scoped to the X-User-Ref tenant (ct_delete_config filters by user).",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-delete-config",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a confirmation message on success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Config 5 deleted"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "config_id": {
                    "type": "integer",
                    "description": "Id of the config to delete."
                  }
                },
                "required": [
                  "config_id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/configs": {
      "get": {
        "summary": "List copy-trade configs",
        "description": "Lists all copy-trade configs owned by the caller (X-User-Ref tenant), each fully serialized via config_to_json.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-list-configs",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "configs[] is the full config object (config_to_json); count is the array length. Empty array if the user has no configs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "configs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "number"
                          },
                          "wallet_id": {
                            "type": "number"
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "copy_buys": {
                            "type": "boolean"
                          },
                          "copy_sells": {
                            "type": "boolean"
                          },
                          "follow_sell_percent": {
                            "type": "boolean"
                          },
                          "buy_mode": {
                            "type": "string"
                          },
                          "buy_fixed_amount_sol": {
                            "type": "number"
                          },
                          "buy_percent": {},
                          "max_buy_amount_sol": {},
                          "min_trigger_buy_sol": {},
                          "max_trigger_buy_sol": {},
                          "buy_slippage_bps": {
                            "type": "number"
                          },
                          "sell_slippage_bps": {
                            "type": "number"
                          },
                          "buy_priority_fee": {},
                          "sell_priority_fee": {},
                          "buy_tip": {},
                          "sell_tip": {},
                          "auto_tip": {
                            "type": "boolean"
                          },
                          "buy_protection": {
                            "type": "boolean"
                          },
                          "sell_protection": {
                            "type": "boolean"
                          },
                          "max_buy_count": {},
                          "current_buy_count": {
                            "type": "number"
                          },
                          "max_per_token": {},
                          "first_interaction_only": {
                            "type": "boolean"
                          },
                          "sell_only_copied": {
                            "type": "boolean"
                          },
                          "buy_only_once": {
                            "type": "boolean"
                          },
                          "skip_deploys": {
                            "type": "boolean"
                          },
                          "reverse_mode": {
                            "type": "boolean"
                          },
                          "sell_on_transfer": {
                            "type": "boolean"
                          },
                          "reverse_min_sell_percent": {},
                          "observe_only": {
                            "type": "boolean"
                          },
                          "start_time": {},
                          "end_time": {},
                          "notify_success": {
                            "type": "boolean"
                          },
                          "notify_failed": {
                            "type": "boolean"
                          },
                          "notify_skipped": {
                            "type": "boolean"
                          },
                          "notify_filtered": {
                            "type": "boolean"
                          },
                          "autosell_profile_id": {},
                          "blacklist": {
                            "type": "array",
                            "items": {}
                          },
                          "filters": {
                            "type": "object",
                            "properties": {}
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "configs": [
                    {
                      "id": 5,
                      "name": "API Config",
                      "source_id": 45,
                      "wallet_id": 12,
                      "is_active": true,
                      "copy_buys": true,
                      "copy_sells": true,
                      "follow_sell_percent": true,
                      "buy_mode": "fixed",
                      "buy_fixed_amount_sol": 0.5,
                      "buy_percent": null,
                      "max_buy_amount_sol": null,
                      "min_trigger_buy_sol": null,
                      "max_trigger_buy_sol": null,
                      "buy_slippage_bps": 1000,
                      "sell_slippage_bps": 1000,
                      "buy_priority_fee": null,
                      "sell_priority_fee": null,
                      "buy_tip": null,
                      "sell_tip": null,
                      "auto_tip": false,
                      "buy_protection": false,
                      "sell_protection": false,
                      "max_buy_count": null,
                      "current_buy_count": 0,
                      "max_per_token": null,
                      "first_interaction_only": false,
                      "sell_only_copied": false,
                      "buy_only_once": false,
                      "skip_deploys": false,
                      "reverse_mode": false,
                      "sell_on_transfer": false,
                      "reverse_min_sell_percent": null,
                      "observe_only": false,
                      "start_time": null,
                      "end_time": null,
                      "notify_success": true,
                      "notify_failed": true,
                      "notify_skipped": false,
                      "notify_filtered": false,
                      "autosell_profile_id": null,
                      "blacklist": [],
                      "filters": {},
                      "created_at": "...",
                      "updated_at": "..."
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}": {
      "get": {
        "summary": "Get copy-trade config",
        "description": "Returns one copy-trade config by id, fully serialized. Ownership-scoped to the X-User-Ref tenant (ct_get_config filters by user).",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-get-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "config is the full config_to_json object (same field set as list_configs entries).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "number"
                        },
                        "wallet_id": {
                          "type": "number"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "copy_buys": {
                          "type": "boolean"
                        },
                        "copy_sells": {
                          "type": "boolean"
                        },
                        "buy_mode": {
                          "type": "string"
                        },
                        "buy_fixed_amount_sol": {
                          "type": "number"
                        },
                        "buy_slippage_bps": {
                          "type": "number"
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        },
                        "blacklist": {
                          "type": "array",
                          "items": {}
                        },
                        "filters": {
                          "type": "object",
                          "properties": {}
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config": {
                    "id": 5,
                    "name": "API Config",
                    "source_id": 45,
                    "wallet_id": 12,
                    "is_active": true,
                    "copy_buys": true,
                    "copy_sells": true,
                    "buy_mode": "fixed",
                    "buy_fixed_amount_sol": 0.5,
                    "buy_slippage_bps": 1000,
                    "sell_slippage_bps": 1000,
                    "blacklist": [],
                    "filters": {},
                    "created_at": "...",
                    "updated_at": "..."
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "put": {
        "summary": "Update copy-trade config",
        "description": "Partial update of a copy-trade config — every body field is optional and only provided fields are applied. Ownership-scoped; returns the full updated config.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-update-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Re-reads and returns the full updated config (config_to_json) after applying all provided fields. Fields are written via several typed DB setters; first failing setter aborts with an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "buy_mode": {
                          "type": "string"
                        },
                        "buy_fixed_amount_sol": {
                          "type": "number"
                        },
                        "buy_slippage_bps": {
                          "type": "number"
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {}
                        },
                        "blacklist": {
                          "type": "array",
                          "items": {}
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config": {
                    "id": 5,
                    "name": "API Config",
                    "buy_mode": "fixed",
                    "buy_fixed_amount_sol": 0.5,
                    "buy_slippage_bps": 1000,
                    "sell_slippage_bps": 1000,
                    "is_active": true,
                    "filters": {},
                    "blacklist": [],
                    "updated_at": "..."
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "buy_mode": {
                    "type": "string",
                    "description": "One of: fixed, exact, percent."
                  },
                  "buy_amount_sol": {
                    "type": "number",
                    "description": "Fixed buy amount in SOL (converted to lamports)."
                  },
                  "buy_percent": {
                    "type": "integer",
                    "description": "Percent buy size (used with buy_mode=percent)."
                  },
                  "max_buy_amount_sol": {
                    "type": "number",
                    "description": "Cap per buy in SOL."
                  },
                  "min_trigger_buy_sol": {
                    "type": "number",
                    "description": "Min source-buy size (SOL) to trigger a copy."
                  },
                  "max_trigger_buy_sol": {
                    "type": "number",
                    "description": "Max source-buy size (SOL) to trigger a copy."
                  },
                  "buy_slippage_bps": {
                    "type": "integer",
                    "description": "Buy slippage in bps."
                  },
                  "sell_slippage_bps": {
                    "type": "integer",
                    "description": "Sell slippage in bps."
                  },
                  "buy_priority_fee": {
                    "type": "integer",
                    "description": "Buy priority fee (lamports)."
                  },
                  "sell_priority_fee": {
                    "type": "integer",
                    "description": "Sell priority fee (lamports)."
                  },
                  "buy_tip": {
                    "type": "integer",
                    "description": "Buy MEV tip (lamports)."
                  },
                  "sell_tip": {
                    "type": "integer",
                    "description": "Sell MEV tip (lamports)."
                  },
                  "copy_buys": {
                    "type": "boolean",
                    "description": "Copy source buys."
                  },
                  "copy_sells": {
                    "type": "boolean",
                    "description": "Copy source sells."
                  },
                  "follow_sell_percent": {
                    "type": "boolean",
                    "description": "Mirror source sell percentages."
                  },
                  "buy_protection": {
                    "type": "boolean",
                    "description": "Enable buy-side protection."
                  },
                  "sell_protection": {
                    "type": "boolean",
                    "description": "Enable sell-side protection."
                  },
                  "first_interaction_only": {
                    "type": "boolean",
                    "description": "Only copy first interaction with a token."
                  },
                  "sell_only_copied": {
                    "type": "boolean",
                    "description": "Only sell tokens that were copy-bought."
                  },
                  "buy_only_once": {
                    "type": "boolean",
                    "description": "Buy each token at most once."
                  },
                  "skip_deploys": {
                    "type": "boolean",
                    "description": "Skip token deploy/creation events."
                  },
                  "reverse_mode": {
                    "type": "boolean",
                    "description": "Reverse-copy (sell when source buys, etc.)."
                  },
                  "sell_on_transfer": {
                    "type": "boolean",
                    "description": "Sell when source transfers out."
                  },
                  "auto_tip": {
                    "type": "boolean",
                    "description": "Auto-compute MEV tip."
                  },
                  "observe_only": {
                    "type": "boolean",
                    "description": "Observe/log without executing."
                  },
                  "reverse_min_sell_percent": {
                    "type": "integer",
                    "description": "Min sell percent for reverse mode (u8)."
                  },
                  "start_time": {
                    "type": "integer",
                    "description": "Active window start (unix seconds)."
                  },
                  "end_time": {
                    "type": "integer",
                    "description": "Active window end (unix seconds)."
                  },
                  "max_buy_count": {
                    "type": "integer",
                    "description": "Lifetime cap on buys."
                  },
                  "max_per_token": {
                    "type": "integer",
                    "description": "Max buys per token."
                  },
                  "name": {
                    "type": "string",
                    "description": "Config label."
                  },
                  "notify_success": {
                    "type": "boolean",
                    "description": "Notify on successful copy."
                  },
                  "notify_failed": {
                    "type": "boolean",
                    "description": "Notify on failed copy."
                  },
                  "notify_skipped": {
                    "type": "boolean",
                    "description": "Notify on skipped copy."
                  },
                  "notify_filtered": {
                    "type": "boolean",
                    "description": "Notify on filtered copy."
                  },
                  "autosell_profile_id": {
                    "type": "integer",
                    "description": "Attach an autosell profile id; <=0 clears it."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/toggle": {
      "post": {
        "summary": "Toggle copy-trade config active",
        "description": "Activates or deactivates a config. Body must contain the boolean `active`. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-toggle-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Message is 'Config {id} activated' or 'Config {id} deactivated'. Body is a free-form JSON object; only `active` is read.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Config 5 activated"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "true to activate, false to deactivate."
                  }
                },
                "required": [
                  "active"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/reset-count": {
      "post": {
        "summary": "Reset copy-trade buy count",
        "description": "Resets the lifetime buy counter (current_buy_count) for a config. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-reset-count",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation message on success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Buy count reset for config 5"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/blacklist": {
      "get": {
        "summary": "Get config blacklist",
        "description": "Returns the token-mint blacklist for a config. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-get-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "blacklist is an array of token-mint strings; count is its length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "blacklist": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "blacklist": [
                    "Es9vMFr...",
                    "So11111..."
                  ],
                  "count": 2
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "post": {
        "summary": "Add mint to config blacklist",
        "description": "Adds a token mint to the config's blacklist (validates the pubkey first). Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-add-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation message echoing the added mint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Added Es9vMFr... to blacklist"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token_mint": {
                    "type": "string",
                    "description": "Token mint pubkey to blacklist."
                  }
                },
                "required": [
                  "token_mint"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove mint from config blacklist",
        "description": "Removes a token mint from the config's blacklist. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-remove-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation message echoing the removed mint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Removed Es9vMFr... from blacklist"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token_mint": {
                    "type": "string",
                    "description": "Token mint pubkey to remove."
                  }
                },
                "required": [
                  "token_mint"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/blacklist/clear": {
      "post": {
        "summary": "Clear config blacklist",
        "description": "Removes all entries from the config's blacklist. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-clear-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation message on success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Blacklist cleared"
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/filters": {
      "get": {
        "summary": "Get config filters",
        "description": "Returns the token filter set (mcap, token_age, liquidity ranges + platform allow-list) for a config. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-get-filters",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "mcap/token_age/liquidity are {min,max} range objects (or null); platforms is a string array; has_filters is true if any filter is set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "mcap": {
                          "type": "object",
                          "properties": {
                            "min": {
                              "type": "number"
                            },
                            "max": {
                              "type": "number"
                            }
                          }
                        },
                        "token_age": {},
                        "liquidity": {
                          "type": "object",
                          "properties": {
                            "min": {
                              "type": "number"
                            },
                            "max": {}
                          }
                        },
                        "platforms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "has_filters": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "filters": {
                    "mcap": {
                      "min": 10000,
                      "max": 1000000
                    },
                    "token_age": null,
                    "liquidity": {
                      "min": 5000,
                      "max": null
                    },
                    "platforms": [
                      "pumpfun"
                    ],
                    "has_filters": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "put": {
        "summary": "Update config filters",
        "description": "Replaces the config's filter set from min/max bounds for mcap, token age, and liquidity plus a platform allow-list. A range is set only if its min or max is provided. Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-update-filters",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Echoes the persisted filter JSON. The full filter set is overwritten by the request (omitting a range clears it).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "mcap": {
                          "type": "object",
                          "properties": {
                            "min": {
                              "type": "number"
                            },
                            "max": {
                              "type": "number"
                            }
                          }
                        },
                        "token_age": {},
                        "liquidity": {},
                        "platforms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Filters updated",
                  "filters": {
                    "mcap": {
                      "min": 10000,
                      "max": 1000000
                    },
                    "token_age": null,
                    "liquidity": null,
                    "platforms": [
                      "pumpfun"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mcap_min": {
                    "type": "integer",
                    "description": "Min market cap."
                  },
                  "mcap_max": {
                    "type": "integer",
                    "description": "Max market cap."
                  },
                  "age_min": {
                    "type": "integer",
                    "description": "Min token age."
                  },
                  "age_max": {
                    "type": "integer",
                    "description": "Max token age."
                  },
                  "liquidity_min": {
                    "type": "integer",
                    "description": "Min liquidity."
                  },
                  "liquidity_max": {
                    "type": "integer",
                    "description": "Max liquidity."
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Allowed platforms/DEXes."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/executions": {
      "get": {
        "summary": "List config executions",
        "description": "Returns the copy-trade execution history for a config (source vs. our trade legs, signatures, latency, status). Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-config-executions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows (default 50, capped at 200)."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Row offset for pagination (default 0)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "executions[] holds per-trade audit rows; count is the page length; limit/offset echo the applied paging (limit clamped to ≤200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "executions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "config_id": {
                            "type": "number"
                          },
                          "source_signature": {
                            "type": "string"
                          },
                          "source_trade_type": {
                            "type": "string"
                          },
                          "source_dex": {
                            "type": "string"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "source_amount_in": {
                            "type": "number"
                          },
                          "source_amount_out": {
                            "type": "number"
                          },
                          "our_amount_in": {
                            "type": "number"
                          },
                          "our_amount_out": {
                            "type": "number"
                          },
                          "our_signature": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "error_message": {},
                          "skip_reason": {},
                          "filter_reason": {},
                          "source_slot": {
                            "type": "number"
                          },
                          "detected_at_us": {
                            "type": "number"
                          },
                          "execution_started_us": {
                            "type": "number"
                          },
                          "execution_completed_us": {
                            "type": "number"
                          },
                          "confirmed_slot": {
                            "type": "number"
                          },
                          "total_ms": {
                            "type": "number"
                          },
                          "swqos_provider": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "offset": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "executions": [
                    {
                      "config_id": 5,
                      "source_signature": "...",
                      "source_trade_type": "buy",
                      "source_dex": "pumpfun",
                      "token_mint": "...",
                      "token_symbol": "FOO",
                      "source_amount_in": 1000000000,
                      "source_amount_out": 12345,
                      "our_amount_in": 500000000,
                      "our_amount_out": 6789,
                      "our_signature": "...",
                      "status": "success",
                      "error_message": null,
                      "skip_reason": null,
                      "filter_reason": null,
                      "source_slot": 123456,
                      "detected_at_us": 1700000000000,
                      "execution_started_us": 1700000000050,
                      "execution_completed_us": 1700000000400,
                      "confirmed_slot": 123458,
                      "total_ms": 350,
                      "swqos_provider": "jito"
                    }
                  ],
                  "count": 1,
                  "limit": 50,
                  "offset": 0
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/stats": {
      "get": {
        "summary": "Get config stats",
        "description": "Returns aggregate execution stats for one config (totals by outcome, success rate, avg latency). Ownership-scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-config-stats",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "stats has total_executions, successful, failed, skipped, filtered counts plus computed success_rate and avg_latency_ms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "total_executions": {
                          "type": "number"
                        },
                        "successful": {
                          "type": "number"
                        },
                        "failed": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        },
                        "filtered": {
                          "type": "number"
                        },
                        "success_rate": {
                          "type": "number"
                        },
                        "avg_latency_ms": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "stats": {
                    "total_executions": 120,
                    "successful": 100,
                    "failed": 10,
                    "skipped": 5,
                    "filtered": 5,
                    "success_rate": 0.83,
                    "avg_latency_ms": 342
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/config/{id}/metrics": {
      "get": {
        "summary": "(Not yet available) Get config live metrics",
        "description": "Intended to return live runtime metrics for a config. Currently a 501 stub — requires the live copy-trade service not wired into V1State.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-config-metrics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/copy-trade/user-stats": {
      "get": {
        "summary": "Get user copy-trade stats",
        "description": "Returns the caller's aggregate copy-trade stats across all their configs (config counts + execution outcome totals + success rate). Scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-user-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "stats aggregates total/active configs and per-outcome execution counts plus computed success_rate across all of the user's configs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "total_configs": {
                          "type": "number"
                        },
                        "active_configs": {
                          "type": "number"
                        },
                        "total_executions": {
                          "type": "number"
                        },
                        "successful_executions": {
                          "type": "number"
                        },
                        "failed_executions": {
                          "type": "number"
                        },
                        "skipped_executions": {
                          "type": "number"
                        },
                        "filtered_executions": {
                          "type": "number"
                        },
                        "success_rate": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "stats": {
                    "total_configs": 3,
                    "active_configs": 2,
                    "total_executions": 250,
                    "successful_executions": 210,
                    "failed_executions": 20,
                    "skipped_executions": 10,
                    "filtered_executions": 10,
                    "success_rate": 0.84
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/copy-trade/detection-stats": {
      "get": {
        "summary": "(Not yet available) Get copy-trade detection stats",
        "description": "Intended to return source-wallet detection metrics from the live engine. Currently a 501 stub — requires the live copy-trade service not wired into V1State.",
        "tags": [
          "Trading API: Copy Trade"
        ],
        "operationId": "copytrade-detection-stats",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope. Calls require_user first, so X-User-Ref is still required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "This endpoint requires the copy-trade service which is not yet wired to V1State"
                  }
                }
              }
            }
          },
          "400": {
            "description": "X-User-Ref header missing"
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "copy-trade service not wired (always"
          }
        }
      }
    },
    "/v1/afk/create-config": {
      "post": {
        "summary": "Create AFK config",
        "description": "Creates a new AFK (auto-buy) config for the calling tenant with the given name. The config is created as a draft (is_saved/is_active default off) and scoped to the X-User-Ref tenant.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-create-config",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "config_id is the new row's integer id. On failure returns HTTP 200 with {\"success\":false,\"error\":\"...\"} (e.g. empty name, DB error).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 42
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing name field"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Config display name. Must be non-empty."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/afk/configs": {
      "get": {
        "summary": "List AFK configs",
        "description": "Returns all AFK configs owned by the calling tenant (resolved from X-User-Ref). Each config is the full serialized AfkConfig object with ~100 filter fields.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-list-configs",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "configs[] holds the full config object (see config_to_json: id, name, is_active, is_saved, platforms, buy_amount_sol, slippage_bps, mev_protect, plus ~100 filter columns such as mcap/liquidity/token_age/buy_count/bonding_progress/dev_*/holder/socials/sell-stage thresholds, time_window_start/end, total_buys, total_sells, created_at, updated_at). count = number of configs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "configs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "is_saved": {
                            "type": "boolean"
                          },
                          "platforms": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "buy_amount_sol": {
                            "type": "number"
                          },
                          "slippage_bps": {
                            "type": "number"
                          },
                          "mev_protect": {
                            "type": "boolean"
                          },
                          "mcap_min_sol": {
                            "type": "number"
                          },
                          "mcap_max_sol": {},
                          "liquidity_min_sol": {},
                          "total_buys": {
                            "type": "number"
                          },
                          "total_sells": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 2,
                  "configs": [
                    {
                      "id": 42,
                      "name": "My AFK",
                      "is_active": false,
                      "is_saved": true,
                      "platforms": [
                        "pumpfun"
                      ],
                      "buy_amount_sol": 0.05,
                      "slippage_bps": 1000,
                      "mev_protect": true,
                      "mcap_min_sol": 10,
                      "mcap_max_sol": null,
                      "liquidity_min_sol": null,
                      "total_buys": 0,
                      "total_sells": 0,
                      "created_at": "2026-06-25T12:00:00+00:00",
                      "updated_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}": {
      "get": {
        "summary": "Get AFK config",
        "description": "Returns a single AFK config by id, scoped to the calling tenant (telegram_id ownership enforced in the DB query). Returns success:false if the config does not belong to the tenant.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "config is the full AfkConfig object (same shape as list_configs items, ~100 filter fields). Not-found / not-owned returns HTTP 200 {\"success\":false,\"error\":\"Config not found\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "is_saved": {
                          "type": "boolean"
                        },
                        "platforms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "buy_amount_sol": {
                          "type": "number"
                        },
                        "slippage_bps": {
                          "type": "number"
                        },
                        "mev_protect": {
                          "type": "boolean"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config": {
                    "id": 42,
                    "name": "My AFK",
                    "is_active": false,
                    "is_saved": true,
                    "platforms": [
                      "pumpfun"
                    ],
                    "buy_amount_sol": 0.05,
                    "slippage_bps": 1000,
                    "mev_protect": true,
                    "created_at": "2026-06-25T12:00:00+00:00",
                    "updated_at": "2026-06-25T12:00:00+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "put": {
        "summary": "Update AFK config field",
        "description": "Updates a single field on an AFK config (one field per call) for the calling tenant. The field name is resolved against the config's column schema (f64/i32/i64/bool/str) plus special handlers for platforms, name, name_exact, name_contains, and time_window_start/end.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-update-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Echoes field and the coerced value (type depends on the column; platforms echoes an array). Invalid value coercion or unknown field returns HTTP 200 success:false with a descriptive error string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "field": {
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "field": "mcap_min_sol",
                  "value": 12.5
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing field or value"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "description": "Column/filter name to update (e.g. buy_amount_sol, mcap_min_sol, platforms, name, time_window_start). Unknown names are rejected."
                  },
                  "value": {
                    "type": "string",
                    "description": "New value as a string; coerced to the column type. \"null\" or \"\" clears nullable filters. For platforms: comma-separated list. For time_window_*: HH:MM or HH:MM:SS."
                  }
                },
                "required": [
                  "field",
                  "value"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete AFK config",
        "description": "Deletes an AFK config (and its associated lists/stages via DB cascade) for the calling tenant. Ownership enforced by telegram_id in the DB query.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-delete-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "message confirms deletion. DB error returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Config #42 deleted"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/toggle": {
      "post": {
        "summary": "Toggle AFK config active",
        "description": "Activates or deactivates an AFK config for the calling tenant. Only configs with is_saved=true can be toggled active (drafts are rejected) — mirrors the UI auto-save-on-activate gate. The engine cache only picks up the flip on next bot restart or UI write.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-toggle-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "is_active is the new state returned by the UPDATE. If the config is not found, not owned, or not saved, returns HTTP 200 {\"success\":false,\"error\":\"Config not found or not saved\"}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "is_active": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 42,
                  "is_active": true
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing active field"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "Desired active state."
                  }
                },
                "required": [
                  "active"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/afk/executions": {
      "get": {
        "summary": "List AFK executions",
        "description": "Returns the calling tenant's AFK auto-buy execution log (most recent first), optionally filtered by config_id. Each row records the attempted buy, signature, success flag and market snapshot.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-executions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows to return. Default 20, capped at 100."
          },
          {
            "name": "config_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Filter executions to a single config."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "executions[] fields: id, config_id, mint, dex_type, buy_amount_sol, signature, success, error_message, mcap_at_buy, liquidity_at_buy, executed_at. count = rows returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "executions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "config_id": {
                            "type": "number"
                          },
                          "mint": {
                            "type": "string"
                          },
                          "dex_type": {
                            "type": "string"
                          },
                          "buy_amount_sol": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error_message": {},
                          "mcap_at_buy": {
                            "type": "number"
                          },
                          "liquidity_at_buy": {
                            "type": "number"
                          },
                          "executed_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "executions": [
                    {
                      "id": 7,
                      "config_id": 42,
                      "mint": "So111...",
                      "dex_type": "pumpfun",
                      "buy_amount_sol": 0.05,
                      "signature": "5xY...",
                      "success": true,
                      "error_message": null,
                      "mcap_at_buy": 12000,
                      "liquidity_at_buy": 30,
                      "executed_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/simulate": {
      "post": {
        "summary": "(Not yet available) Simulate AFK filters (stub)",
        "description": "Intended to evaluate a config's filters against a given mint. Currently not implemented in the multi-tenant API — RPC/indexer are not wired into V1State.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-simulate",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Always returns the not_implemented envelope at HTTP 200; never runs a real simulation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": false,
                  "error": {
                    "code": "not_implemented",
                    "message": "Simulate requires rpc/indexer which are not yet wired to V1State"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mint": {
                    "type": "string",
                    "description": "Token mint to simulate against."
                  },
                  "config_id": {
                    "type": "integer",
                    "description": "AFK config id to evaluate."
                  }
                },
                "required": [
                  "mint",
                  "config_id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/afk/config/{id}/whitelist-mints": {
      "get": {
        "summary": "List whitelist mints",
        "description": "Returns the mint-address whitelist for an AFK config (tenant-scoped). When set, only these mints are eligible for auto-buy.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-whitelist-mints",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "mints[] fields: id, address, created_at. count = entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "mints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "address": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "mints": [
                    {
                      "id": 3,
                      "address": "So111...",
                      "created_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add whitelist mint",
        "description": "Adds a mint address to an AFK config's whitelist (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-whitelist-mint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Empty address returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Added mint So111..."
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing address"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Mint address to whitelist. Must be non-empty."
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear whitelist mints",
        "description": "Removes all whitelist mint entries from an AFK config (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-whitelist-mints",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears the entire list for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All whitelist mints cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/whitelist-deployers": {
      "get": {
        "summary": "List whitelist deployers",
        "description": "Returns the deployer-address whitelist for an AFK config (tenant-scoped). When set, only tokens from these deployers are eligible.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-whitelist-deployers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "deployers[] fields: id, address, label (nullable), created_at. count = entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "deployers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "address": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "deployers": [
                    {
                      "id": 4,
                      "address": "Dev111...",
                      "label": "trusted dev",
                      "created_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add whitelist deployer",
        "description": "Adds a deployer address (with optional label) to an AFK config's deployer whitelist (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-whitelist-deployer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Empty address returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Added deployer Dev111..."
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing address"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Deployer wallet address. Must be non-empty."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optional human label for the deployer."
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear whitelist deployers",
        "description": "Removes all deployer whitelist entries from an AFK config (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-whitelist-deployers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears the entire deployer list for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All whitelist deployers cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/blacklist": {
      "get": {
        "summary": "Get blacklist (tokens + devs)",
        "description": "Returns both the token-address and deployer-address blacklists for an AFK config (tenant-scoped) in a single response.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "token_addresses + token_count and dev_addresses + dev_count are returned together (arrays of address strings).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "token_addresses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_count": {
                      "type": "number"
                    },
                    "dev_addresses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "dev_count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "token_addresses": [
                    "Mint111..."
                  ],
                  "token_count": 1,
                  "dev_addresses": [
                    "Dev111..."
                  ],
                  "dev_count": 1
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add to blacklist",
        "description": "Adds a token or deployer address to an AFK config's blacklist (tenant-scoped). list_type selects which list.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-to-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Empty address or list_type not in {token,dev} returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Blacklisted Mint111... (token)"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing fields"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "list_type": {
                    "type": "string",
                    "description": "Which blacklist: must be \"token\" or \"dev\"."
                  },
                  "address": {
                    "type": "string",
                    "description": "Address to blacklist. Must be non-empty."
                  }
                },
                "required": [
                  "list_type",
                  "address"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear blacklist",
        "description": "Clears both the token and deployer blacklists for an AFK config (tenant-scoped) in one call.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-blacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears both token and dev blacklist lists (runs both clears concurrently).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All blacklist entries cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/blacklist-words": {
      "get": {
        "summary": "List blacklist words",
        "description": "Returns the name/symbol blacklist words for an AFK config (tenant-scoped). Tokens whose name/symbol match a word are skipped.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-blacklist-words",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "words[] fields: id, word, created_at. count = entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "words": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "word": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "words": [
                    {
                      "id": 9,
                      "word": "scam",
                      "created_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add blacklist words",
        "description": "Adds one or more words to an AFK config's name/symbol blacklist (tenant-scoped). Returns how many were newly added vs submitted (dedup).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-blacklist-words",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "added = newly inserted rows; submitted = number of words in the request (difference = duplicates skipped). Empty array returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "added": {
                      "type": "number"
                    },
                    "submitted": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "added": 2,
                  "submitted": 3
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing words array"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "words": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of words to blacklist. Must be non-empty."
                  }
                },
                "required": [
                  "words"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear blacklist words",
        "description": "Removes all blacklist words from an AFK config (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-blacklist-words",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears the entire word list for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All blacklist words cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/sell-stages": {
      "get": {
        "summary": "List sell stages",
        "description": "Returns the laddered auto-sell stages for an AFK config (tenant-scoped). Each stage sells a percentage at a price multiplier.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-sell-stages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "stages[] fields: id, stage_order, sell_pct, multiplier, created_at. count = stages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "stage_order": {
                            "type": "number"
                          },
                          "sell_pct": {
                            "type": "number"
                          },
                          "multiplier": {
                            "type": "number"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "stages": [
                    {
                      "id": 11,
                      "stage_order": 1,
                      "sell_pct": 50,
                      "multiplier": 2,
                      "created_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add sell stage",
        "description": "Adds an auto-sell stage (sell_pct at a price multiplier) to an AFK config (tenant-scoped). Validates sell_pct in (0,100] and multiplier > 0.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-sell-stage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Out-of-range sell_pct or non-positive multiplier returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Added sell stage: 50% at 2x"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing fields"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sell_pct": {
                    "type": "number",
                    "description": "Percent of holdings to sell at this stage. Must be > 0 and <= 100."
                  },
                  "multiplier": {
                    "type": "number",
                    "description": "Price multiplier (e.g. 2.0 = 2x) that triggers this stage. Must be > 0."
                  }
                },
                "required": [
                  "sell_pct",
                  "multiplier"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear sell stages",
        "description": "Removes all auto-sell stages from an AFK config (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-sell-stages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears every sell stage for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All sell stages cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/remove-sell-stage": {
      "post": {
        "summary": "Remove sell stage",
        "description": "Removes a single auto-sell stage from an AFK config by its stage_order (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-remove-sell-stage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Removes the stage matching stage_order. DB error returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Removed sell stage #1"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing stage_order"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage_order": {
                    "type": "integer",
                    "description": "Order index of the stage to remove."
                  }
                },
                "required": [
                  "stage_order"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/afk/config/{id}/smart-wallets": {
      "get": {
        "summary": "List smart wallets",
        "description": "Returns the smart-wallet list for an AFK config (tenant-scoped). Used with smart_wallet_threshold to require buys from N tracked wallets before auto-buying.",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-get-smart-wallets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "smart_wallets[] fields: id, address (DB column wallet_address), label (nullable), created_at. count = entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "smart_wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "address": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "smart_wallets": [
                    {
                      "id": 5,
                      "address": "Whale111...",
                      "label": "alpha",
                      "created_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Add smart wallet",
        "description": "Adds a smart wallet (with optional label) to an AFK config's tracked wallet list (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-add-smart-wallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Empty address returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Added smart wallet Whale111..."
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing address"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address to track. Must be non-empty."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optional human label for the wallet."
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Clear smart wallets",
        "description": "Removes all smart wallets from an AFK config (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-clear-smart-wallets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Clears the entire smart-wallet list for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "All smart wallets cleared"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        }
      }
    },
    "/v1/afk/config/{id}/remove-smart-wallet": {
      "post": {
        "summary": "Remove smart wallet",
        "description": "Removes a single smart wallet from an AFK config by address (tenant-scoped).",
        "tags": [
          "Trading API: AFK Auto-Buy"
        ],
        "operationId": "afk-remove-smart-wallet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AFK config id."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Removes the matching wallet. DB error returns HTTP 200 success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Removed smart wallet Whale111..."
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "402": {
            "description": "insufficient credits"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "malformed body / missing address"
          },
          "429": {
            "description": "rate limit exceeded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address to remove."
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/sniper/create-config": {
      "post": {
        "summary": "Create sniper config",
        "description": "Creates a new auto-sniper/TG-Auto config for the calling tenant and immediately marks it saved (is_saved=true). The target wallet is verified to belong to the caller before creation so a tenant cannot snipe-buy through another tenant's wallet.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-create-config",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "config_id is the new row id; echoes name, wallet_id (resolved), and buy_amount (lamports).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "wallet_id": {
                      "type": "number"
                    },
                    "buy_amount": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "name": "my snipe",
                  "wallet_id": 3,
                  "buy_amount": 1000000
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "missing/invalid body, no_active_wallet, buy_amount <= 0, or wallet_id does not belong to caller (returned as success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB unreachable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Display name for the config"
                  },
                  "wallet_id": {
                    "type": "integer",
                    "description": "Wallet to buy with; must belong to caller. Defaults to the caller's most recent active wallet when omitted"
                  },
                  "buy_amount": {
                    "type": "integer",
                    "description": "Buy size in lamports; must be positive"
                  }
                },
                "required": [
                  "name",
                  "buy_amount"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/sniper/configs": {
      "get": {
        "summary": "List sniper configs",
        "description": "Returns all sniper/TG-Auto/X-Auto configs owned by the calling tenant.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-list-configs",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "configs is an array of full config objects (see config_to_json fields incl. buy_amount lamports + buy_amount_sol, filters JSON, X-Auto monitor flags); count is the array length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "configs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "wallet_id": {
                            "type": "number"
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "is_saved": {
                            "type": "boolean"
                          },
                          "buy_amount": {
                            "type": "number"
                          },
                          "buy_amount_sol": {
                            "type": "number"
                          },
                          "buy_slippage_bps": {
                            "type": "number"
                          },
                          "buy_priority_fee": {},
                          "buy_tip": {},
                          "auto_tip": {
                            "type": "boolean"
                          },
                          "buy_protection": {
                            "type": "boolean"
                          },
                          "max_buy_count": {},
                          "current_buy_count": {
                            "type": "number"
                          },
                          "max_per_token": {
                            "type": "number"
                          },
                          "filters": {
                            "type": "object",
                            "properties": {}
                          },
                          "notify_success": {
                            "type": "boolean"
                          },
                          "notify_failed": {
                            "type": "boolean"
                          },
                          "notify_filtered": {
                            "type": "boolean"
                          },
                          "autosell_profile_id": {},
                          "x_handle": {},
                          "x_user_id": {},
                          "monitor_posts": {
                            "type": "boolean"
                          },
                          "monitor_replies": {
                            "type": "boolean"
                          },
                          "monitor_reposts": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "configs": [
                    {
                      "id": 12,
                      "name": "my snipe",
                      "wallet_id": 3,
                      "is_active": false,
                      "is_saved": true,
                      "buy_amount": 1000000,
                      "buy_amount_sol": 0.001,
                      "buy_slippage_bps": 1000,
                      "buy_priority_fee": null,
                      "buy_tip": null,
                      "auto_tip": true,
                      "buy_protection": false,
                      "max_buy_count": null,
                      "current_buy_count": 0,
                      "max_per_token": 1,
                      "filters": {},
                      "notify_success": true,
                      "notify_failed": true,
                      "notify_filtered": false,
                      "autosell_profile_id": null,
                      "x_handle": null,
                      "x_user_id": null,
                      "monitor_posts": true,
                      "monitor_replies": false,
                      "monitor_reposts": false,
                      "created_at": "...",
                      "updated_at": "..."
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error fetching configs"
          }
        }
      }
    },
    "/v1/sniper/config/{id}": {
      "get": {
        "summary": "Get sniper config",
        "description": "Returns one sniper config (scoped to the caller) plus its channel count and a human source summary. Returns not-found if the id does not belong to the caller.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-get-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "config is the full config object; channel_count is the number of attached TG channels; source_summary is a derived human label.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "wallet_id": {
                          "type": "number"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "is_saved": {
                          "type": "boolean"
                        },
                        "buy_amount": {
                          "type": "number"
                        },
                        "buy_amount_sol": {
                          "type": "number"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {}
                        },
                        "x_handle": {},
                        "monitor_posts": {
                          "type": "boolean"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    },
                    "channel_count": {
                      "type": "number"
                    },
                    "source_summary": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config": {
                    "id": 12,
                    "name": "my snipe",
                    "wallet_id": 3,
                    "is_active": false,
                    "is_saved": true,
                    "buy_amount": 1000000,
                    "buy_amount_sol": 0.001,
                    "filters": {},
                    "x_handle": null,
                    "monitor_posts": true,
                    "created_at": "...",
                    "updated_at": "..."
                  },
                  "channel_count": 2,
                  "source_summary": "2 channels"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "404": {
            "description": "config id not found for caller (returned as success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        }
      },
      "put": {
        "summary": "Update sniper config fields",
        "description": "Bulk-updates arbitrary config fields from a string-keyed map; each field is applied individually and the response reports which succeeded vs failed. Config ownership is verified before any update.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-update-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On full success returns updated_fields. On partial failure returns success:false with both updated_fields and errors (array of \"field: message\").",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "updated_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "config_id": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "updated_fields": [
                    "buy_slippage_bps"
                  ],
                  "config_id": 12
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "404": {
            "description": "config id not found for caller"
          },
          "422": {
            "description": "empty fields map or invalid body (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "type": "object",
                    "description": "Map of field name -> string value to apply (e.g. {\"buy_slippage_bps\":\"1500\",\"max_buy_count\":\"5\"}). Must be non-empty"
                  }
                },
                "required": [
                  "fields"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete sniper config",
        "description": "Deletes a sniper config owned by the caller (ownership enforced at the SQL layer via telegram_id).",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-delete-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "message confirms the deleted config id.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Config 12 deleted"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "delete failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        }
      }
    },
    "/v1/sniper/config/{id}/toggle": {
      "post": {
        "summary": "Toggle sniper config active",
        "description": "Activates or deactivates a sniper config (turns the snipe worker on/off for it). Ownership verified before toggle.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-toggle-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "is_active echoes the requested state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "is_active": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "is_active": true
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "404": {
            "description": "config id not found for caller"
          },
          "422": {
            "description": "invalid body or toggle failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "true to activate, false to deactivate"
                  }
                },
                "required": [
                  "active"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/sniper/config/{id}/reset-count": {
      "post": {
        "summary": "Reset sniper buy count",
        "description": "Resets the config's current_buy_count back to 0 (clears the lifetime buy cap counter so a capped config resumes buying). Ownership verified first.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-reset-count",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms current_buy_count reset to 0 for the config.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "message": "Buy count reset to 0"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "404": {
            "description": "config id not found for caller"
          },
          "422": {
            "description": "reset failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        }
      }
    },
    "/v1/sniper/config/{id}/channels": {
      "get": {
        "summary": "List sniper config channels",
        "description": "Lists the Telegram channels attached to a sniper config (the sources it monitors for token mints).",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-list-channels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "channels is an array of channel objects (id, channel_username, is_preset, added_at, resolved_chat_id); count is the length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "config_id": {
                            "type": "number"
                          },
                          "channel_username": {
                            "type": "string"
                          },
                          "is_preset": {
                            "type": "boolean"
                          },
                          "added_at": {
                            "type": "string"
                          },
                          "resolved_chat_id": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "channels": [
                    {
                      "id": 4,
                      "config_id": 12,
                      "channel_username": "somechannel",
                      "is_preset": false,
                      "added_at": "...",
                      "resolved_chat_id": -1001234567890
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "fetch failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        }
      },
      "post": {
        "summary": "Add sniper config channel",
        "description": "Attaches a Telegram channel to a sniper config. The username is normalized (leading @ stripped, lowercased) before storage.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-add-channel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "channel_username is echoed in normalized form (no @, lowercased).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "channel_username": {
                      "type": "string"
                    },
                    "is_preset": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "channel_username": "somechannel",
                  "is_preset": false
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "empty channel_username, invalid body, or add failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel_username": {
                    "type": "string",
                    "description": "Telegram channel username to monitor (with or without leading @). Required, non-empty"
                  },
                  "is_preset": {
                    "type": "boolean",
                    "description": "Whether this is a curated preset channel. Defaults to false"
                  }
                },
                "required": [
                  "channel_username"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove sniper config channel",
        "description": "Detaches a Telegram channel from a sniper config. Channel identified by username in the request body (normalized: @ stripped, lowercased).",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-remove-channel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "removed_channel is echoed in normalized form (no @, lowercased).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "removed_channel": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "removed_channel": "somechannel"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "empty channel_username, invalid body, or remove failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel_username": {
                    "type": "string",
                    "description": "Channel username to remove (with or without leading @). Required, non-empty"
                  }
                },
                "required": [
                  "channel_username"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/sniper/executions": {
      "get": {
        "summary": "List sniper executions",
        "description": "Returns sniper execution history (detected/bought/filtered/failed events). With ?config_id it returns that config's history; without it, fans out across only the caller's own configs (user-scoped, never global).",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-executions",
        "parameters": [
          {
            "name": "config_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Restrict to a single config's executions. When omitted, returns recent executions across all of the caller's configs"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max rows to return. Defaults to 20, capped at 100"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "executions is an array of execution objects (see execution_to_json). config_id is only present in the response when supplied in the query. count is the array length.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "executions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "config_id": {
                            "type": "number"
                          },
                          "source_type": {
                            "type": "string"
                          },
                          "token_mint": {
                            "type": "string"
                          },
                          "token_symbol": {
                            "type": "string"
                          },
                          "amount_in": {
                            "type": "number"
                          },
                          "amount_out": {
                            "type": "number"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "error_message": {},
                          "filter_reason": {},
                          "channel_username": {
                            "type": "string"
                          },
                          "message_id": {
                            "type": "number"
                          },
                          "x_post_id": {},
                          "x_post_type": {},
                          "detected_at": {
                            "type": "string"
                          },
                          "executed_at": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "executions": [
                    {
                      "id": 99,
                      "config_id": 12,
                      "source_type": "tg",
                      "token_mint": "...",
                      "token_symbol": "FOO",
                      "amount_in": 1000000,
                      "amount_out": 123456,
                      "signature": "...",
                      "status": "success",
                      "error_message": null,
                      "filter_reason": null,
                      "channel_username": "somechannel",
                      "message_id": 42,
                      "x_post_id": null,
                      "x_post_type": null,
                      "detected_at": "...",
                      "executed_at": "...",
                      "created_at": "..."
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "422": {
            "description": "fetch failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        }
      }
    },
    "/v1/sniper/config/{id}/x-settings": {
      "put": {
        "summary": "Update sniper X-Auto settings",
        "description": "Updates X (Twitter) monitoring settings on a sniper config: sets/removes the X handle as a source, sets/clears x_user_id, and toggles monitor_posts/replies/reposts. Each provided field is applied individually with per-field success/error reporting. Ownership verified first.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "sniper-update-x-settings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Sniper config ID (caller-owned)"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "updated_fields lists applied changes (e.g. \"x_handle\", \"x_handle (removed)\", \"x_user_id (cleared)\"). On partial failure returns success:false with an additional errors array.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "config_id": {
                      "type": "number"
                    },
                    "updated_fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "config_id": 12,
                  "updated_fields": [
                    "x_handle",
                    "monitor_posts"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid API key"
          },
          "403": {
            "description": "key lacks automation scope"
          },
          "404": {
            "description": "config id not found for caller"
          },
          "422": {
            "description": "no X fields provided, invalid body, or all updates failed (success:false error envelope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB error"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "x_handle": {
                    "type": "string",
                    "description": "X handle to monitor. Empty string removes the X source; non-empty sets it"
                  },
                  "x_user_id": {
                    "type": "string",
                    "description": "Numeric X user id. Empty string clears it; non-empty sets it"
                  },
                  "monitor_posts": {
                    "type": "boolean",
                    "description": "Whether to monitor original posts"
                  },
                  "monitor_replies": {
                    "type": "boolean",
                    "description": "Whether to monitor replies"
                  },
                  "monitor_reposts": {
                    "type": "boolean",
                    "description": "Whether to monitor reposts"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/autosell/create": {
      "post": {
        "summary": "Create AutoSell profile",
        "description": "Creates a new named AutoSell profile for the calling tenant. The user is resolved from the X-User-Ref header (tenancy); the new profile starts with default rules and returns its numeric id.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-create",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On success returns the new profile_id (i32). On failure returns {\"success\":false,\"error\":\"<message>\"} with HTTP 200 (e.g. empty name, DB error).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "profile_id": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "profile_id": 42
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Profile display name. Must be non-empty (trimmed)."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/autosell/profiles": {
      "get": {
        "summary": "List AutoSell profiles",
        "description": "Lists all AutoSell profiles owned by the calling tenant (resolved from X-User-Ref). Returns a count plus the full serialized profile objects.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-list-profiles",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "profiles[] is the full profile object (same shape as get/update). count is profiles.len(). Errors return HTTP 200 with success:false.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "is_saved": {
                            "type": "boolean"
                          },
                          "fixed_rules": {
                            "type": "array",
                            "items": {}
                          },
                          "trailing_enabled": {
                            "type": "boolean"
                          },
                          "trailing_activation_pct": {
                            "type": "number"
                          },
                          "trailing_drawdown_pct": {
                            "type": "number"
                          },
                          "moonbag_pct": {
                            "type": "number"
                          },
                          "expiry_seconds": {
                            "type": "number"
                          },
                          "sell_on_expiry": {
                            "type": "boolean"
                          },
                          "sell_slippage_bps": {
                            "type": "number"
                          },
                          "mev_protect": {
                            "type": "boolean"
                          },
                          "priority_fee_lamports": {},
                          "gas_cu_price": {},
                          "sell_on_fee_claim": {
                            "type": "boolean"
                          },
                          "fee_claim_sell_percent": {},
                          "fee_claim_min_sol": {},
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "profiles": [
                    {
                      "id": 42,
                      "name": "Moonbag",
                      "is_active": true,
                      "is_saved": true,
                      "fixed_rules": [],
                      "trailing_enabled": false,
                      "trailing_activation_pct": 0,
                      "trailing_drawdown_pct": 0,
                      "moonbag_pct": 0,
                      "expiry_seconds": 0,
                      "sell_on_expiry": false,
                      "sell_slippage_bps": 1000,
                      "mev_protect": true,
                      "priority_fee_lamports": null,
                      "gas_cu_price": null,
                      "sell_on_fee_claim": false,
                      "fee_claim_sell_percent": null,
                      "fee_claim_min_sol": null,
                      "created_at": "2026-06-25T12:00:00+00:00",
                      "updated_at": "2026-06-25T12:00:00+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        }
      }
    },
    "/v1/autosell/profile/{id}": {
      "get": {
        "summary": "Get AutoSell profile",
        "description": "Fetches a single AutoSell profile by id, scoped to the calling tenant (resolved from X-User-Ref). 404-equivalent when the profile does not exist or is not owned by the tenant.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-get-profile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AutoSell profile id (i32)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "profile holds all profile fields. When the profile is missing/not owned, returns {\"success\":false,\"error\":\"Profile not found\"} (HTTP 200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "is_saved": {
                          "type": "boolean"
                        },
                        "fixed_rules": {
                          "type": "array",
                          "items": {}
                        },
                        "trailing_enabled": {
                          "type": "boolean"
                        },
                        "trailing_activation_pct": {
                          "type": "number"
                        },
                        "trailing_drawdown_pct": {
                          "type": "number"
                        },
                        "moonbag_pct": {
                          "type": "number"
                        },
                        "expiry_seconds": {
                          "type": "number"
                        },
                        "sell_on_expiry": {
                          "type": "boolean"
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        },
                        "mev_protect": {
                          "type": "boolean"
                        },
                        "priority_fee_lamports": {},
                        "gas_cu_price": {},
                        "sell_on_fee_claim": {
                          "type": "boolean"
                        },
                        "fee_claim_sell_percent": {},
                        "fee_claim_min_sol": {},
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "profile": {
                    "id": 42,
                    "name": "Moonbag",
                    "is_active": true,
                    "is_saved": true,
                    "fixed_rules": [],
                    "trailing_enabled": false,
                    "trailing_activation_pct": 0,
                    "trailing_drawdown_pct": 0,
                    "moonbag_pct": 0,
                    "expiry_seconds": 0,
                    "sell_on_expiry": false,
                    "sell_slippage_bps": 1000,
                    "mev_protect": true,
                    "priority_fee_lamports": null,
                    "gas_cu_price": null,
                    "sell_on_fee_claim": false,
                    "fee_claim_sell_percent": null,
                    "fee_claim_min_sol": null,
                    "created_at": "2026-06-25T12:00:00+00:00",
                    "updated_at": "2026-06-25T12:00:00+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        }
      },
      "put": {
        "summary": "Update AutoSell profile",
        "description": "Partially updates an AutoSell profile (all body fields optional); only provided fields are written. Scoped to the calling tenant (X-User-Ref). Returns the full updated profile.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-update-profile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AutoSell profile id (i32)."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Each provided field is applied via a separate DB update; on any sub-update error returns success:false immediately. On success re-fetches and returns the full updated profile.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "is_saved": {
                          "type": "boolean"
                        },
                        "fixed_rules": {
                          "type": "array",
                          "items": {}
                        },
                        "trailing_enabled": {
                          "type": "boolean"
                        },
                        "trailing_activation_pct": {
                          "type": "number"
                        },
                        "trailing_drawdown_pct": {
                          "type": "number"
                        },
                        "moonbag_pct": {
                          "type": "number"
                        },
                        "expiry_seconds": {
                          "type": "number"
                        },
                        "sell_on_expiry": {
                          "type": "boolean"
                        },
                        "sell_slippage_bps": {
                          "type": "number"
                        },
                        "mev_protect": {
                          "type": "boolean"
                        },
                        "priority_fee_lamports": {},
                        "gas_cu_price": {},
                        "sell_on_fee_claim": {
                          "type": "boolean"
                        },
                        "fee_claim_sell_percent": {},
                        "fee_claim_min_sol": {},
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "profile": {
                    "id": 42,
                    "name": "Moonbag",
                    "is_active": true,
                    "is_saved": true,
                    "fixed_rules": [],
                    "trailing_enabled": true,
                    "trailing_activation_pct": 50,
                    "trailing_drawdown_pct": 10,
                    "moonbag_pct": 20,
                    "expiry_seconds": 0,
                    "sell_on_expiry": false,
                    "sell_slippage_bps": 1500,
                    "mev_protect": true,
                    "priority_fee_lamports": null,
                    "gas_cu_price": null,
                    "sell_on_fee_claim": false,
                    "fee_claim_sell_percent": null,
                    "fee_claim_min_sol": null,
                    "created_at": "2026-06-25T12:00:00+00:00",
                    "updated_at": "2026-06-25T12:05:00+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New profile name. Must be non-empty (trimmed) if provided."
                  },
                  "fixed_rules": {
                    "type": "object",
                    "description": "Fixed TP/SL ladder rules (raw JSON, stored as-is)."
                  },
                  "trailing_enabled": {
                    "type": "boolean",
                    "description": "Enable/disable trailing stop. Triggers a trailing update if any trailing_* field is present."
                  },
                  "trailing_activation_pct": {
                    "type": "number",
                    "description": "Profit % at which the trailing stop activates."
                  },
                  "trailing_drawdown_pct": {
                    "type": "number",
                    "description": "Drawdown % from peak that triggers the sell."
                  },
                  "moonbag_pct": {
                    "type": "integer",
                    "description": "Percent of position to retain as a moonbag (not sold)."
                  },
                  "expiry_seconds": {
                    "type": "integer",
                    "description": "Seconds until the profile auto-expires (0 = no expiry)."
                  },
                  "sell_slippage_bps": {
                    "type": "integer",
                    "description": "Sell slippage tolerance in basis points."
                  },
                  "mev_protect": {
                    "type": "boolean",
                    "description": "Route auto-sells through MEV-protected providers."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete AutoSell profile",
        "description": "Deletes an AutoSell profile by id, scoped to the calling tenant (X-User-Ref). Returns success:false if no matching owned profile was found.",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-delete-profile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "AutoSell profile id (i32) to delete."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "On a no-op delete (profile missing/not owned) returns {\"success\":false,\"error\":\"Profile not found\"} (HTTP 200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Profile #42 deleted"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        }
      }
    },
    "/v1/autosell/attach": {
      "post": {
        "summary": "Attach AutoSell profile",
        "description": "Attaches an AutoSell profile either as the tenant's global default (source=global) or to a specific AFK config (source=afk, requires source_config_id). All operations scoped to the calling tenant (X-User-Ref).",
        "tags": [
          "Trading API: Sniper & Auto-Sell"
        ],
        "operationId": "autosell-attach-profile",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "source=global returns 'set as global default'; source=afk returns 'attached to AFK config #N'. Unknown source, missing source_config_id for afk, or DB errors return {\"success\":false,\"error\":\"...\"} (HTTP 200).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Profile #42 set as global default"
                }
              }
            }
          },
          "401": {
            "description": "missing/invalid X-API-Key"
          },
          "403": {
            "description": "API key lacks automation scope"
          },
          "422": {
            "description": "malformed JSON body"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "service unavailable / DB-only mode"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile_id": {
                    "type": "integer",
                    "description": "AutoSell profile id to attach."
                  },
                  "source": {
                    "type": "string",
                    "description": "Attach target. Valid values: \"global\" (set as tenant default) or \"afk\" (attach to an AFK config)."
                  },
                  "source_config_id": {
                    "type": "integer",
                    "description": "Target AFK config id. Required when source=\"afk\"; ignored for source=\"global\"."
                  }
                },
                "required": [
                  "profile_id",
                  "source"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Health check",
        "description": "Public, unauthenticated liveness/readiness probe. Returns DB reachability plus build/version markers; with ?deep=1 it also probes RPC reachability (cached ~5s) and treasury config. Returns 503 only when the DB is unreachable so load balancers drain the node.",
        "tags": [
          "Trading API: System"
        ],
        "operationId": "system-health",
        "parameters": [
          {
            "name": "deep",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "When set to 1/true/yes/on, also probes RPC reachability (rpc_ok, cached at most once per ~5s) and treasury_configured, and folds rpc_ok into status. Omit for the cheap single DB-ping path."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "data.status is \"ok\" or \"degraded\". db_ok = SELECT 1 succeeded. workers_mode is \"on\"|\"off\". build_version = bot BOT_VERSION deploy marker; crate_version = CARGO_PKG_VERSION. rpc_ok and treasury_configured only present when ?deep=1; in deep mode status becomes \"ok\" only if both db_ok && rpc_ok. HTTP 200 whenever db_ok (even if rpc degraded); HTTP 503 only when DB is down.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "db_ok": {
                          "type": "boolean"
                        },
                        "workers_mode": {
                          "type": "string"
                        },
                        "build_version": {
                          "type": "string"
                        },
                        "crate_version": {
                          "type": "string"
                        },
                        "rpc_ok": {
                          "type": "boolean"
                        },
                        "treasury_configured": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "status": "ok",
                    "db_ok": true,
                    "workers_mode": "on",
                    "build_version": "0.7.441",
                    "crate_version": "1.0.0",
                    "rpc_ok": true,
                    "treasury_configured": true
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "DB unreachable (db_ok=false); body still has success:true with data.status=degraded"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "summary": "Usage / credit snapshot",
        "description": "App-level credit and quota snapshot for the calling X-API-Key. Free (0 credits), no X-User-Ref / tenancy — reports the key's plan, scopes, owner wallet, and credit window usage. Read scope.",
        "tags": [
          "Trading API: System"
        ],
        "operationId": "system-usage",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.credits_monthly is null for unlimited keys (then unlimited=true and credits_remaining is not meaningful). credits_used/credits_remaining are scoped to the rolling window of window_days, resetting at window_resets_at (RFC3339). rate_per_min and rate_burst are the key's token-bucket limits. On unknown app returns 200 with success:false error.code=not_found; on DB error returns 200 with success:false error.code=db.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "owner_wallet": {
                          "type": "string"
                        },
                        "credits_monthly": {
                          "type": "number"
                        },
                        "credits_used": {
                          "type": "number"
                        },
                        "credits_remaining": {
                          "type": "number"
                        },
                        "unlimited": {
                          "type": "boolean"
                        },
                        "window_days": {
                          "type": "number"
                        },
                        "window_resets_at": {
                          "type": "string"
                        },
                        "rate_per_min": {
                          "type": "number"
                        },
                        "rate_burst": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "Stryke-terminal",
                    "tier": "paid",
                    "scopes": [
                      "read",
                      "trade"
                    ],
                    "owner_wallet": "7xKW...",
                    "credits_monthly": 100000,
                    "credits_used": 1234,
                    "credits_remaining": 98766,
                    "unlimited": false,
                    "window_days": 30,
                    "window_resets_at": "2026-07-26T00:00:00+00:00",
                    "rate_per_min": 600,
                    "rate_burst": 120
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key (require_app"
          },
          "403": {
            "description": "key lacks read scope"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/programs/{programId}": {
      "get": {
        "summary": "Program (smart-contract) intel",
        "description": "Program account + upgrade state, activity sampling (tx/min, fail%, last-active), a tx-type mix to label an unknown program, and recent decoded transactions. Consolidates a direct-Stryke's node layer program page into one allow-listed call.",
        "tags": [
          "Programs"
        ],
        "operationId": "programs-get",
        "parameters": [
          {
            "name": "programId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Program (smart-contract) address, base58."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "account{} — executable, owner, loader, dataSize (bytes), lamports/sol, upgradeable, upgradeAuthority, immutable, frozen (=immutable===true), lastDeploySlot, lastDeployTs. label from the known-program table then the static service registry (null if unknown). activity{} sampled from up to 1000 recent signatures: sampled count, txPerMin (over the sampled span, null if no span), failPct (sampled), lastActiveTs (epoch sec), lowActivity (sampled < 50). typeMix[] = enhanced-tx type histogram (over up to 100 txs) sorted by count, with pct. recentTxs[] = up to 25 decoded txs {type, description, feePayer, signature, ts, error}. Cached 120s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "programId": {
                      "type": "string"
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "executable": {
                          "type": "boolean"
                        },
                        "owner": {
                          "type": "string"
                        },
                        "loader": {
                          "type": "string"
                        },
                        "dataSize": {
                          "type": "number"
                        },
                        "lamports": {
                          "type": "number"
                        },
                        "sol": {
                          "type": "number"
                        },
                        "upgradeable": {
                          "type": "boolean"
                        },
                        "upgradeAuthority": {
                          "type": "string"
                        },
                        "immutable": {
                          "type": "boolean"
                        },
                        "frozen": {
                          "type": "boolean"
                        },
                        "lastDeploySlot": {
                          "type": "number"
                        },
                        "lastDeployTs": {
                          "type": "number"
                        }
                      }
                    },
                    "label": {
                      "type": "string"
                    },
                    "activity": {
                      "type": "object",
                      "properties": {
                        "sampled": {
                          "type": "number"
                        },
                        "txPerMin": {
                          "type": "number"
                        },
                        "failPct": {
                          "type": "number"
                        },
                        "lastActiveTs": {
                          "type": "number"
                        },
                        "lowActivity": {
                          "type": "boolean"
                        }
                      }
                    },
                    "typeMix": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          },
                          "pct": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "recentTxs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "feePayer": {
                            "type": "string"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "ts": {
                            "type": "number"
                          },
                          "error": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
                  "account": {
                    "executable": true,
                    "owner": "BPFLoaderUpgradeab1e11111111111111111111111",
                    "loader": "BPFLoaderUpgradeab1e11111111111111111111111",
                    "dataSize": 36,
                    "lamports": 1141440,
                    "sol": 0.00114144,
                    "upgradeable": true,
                    "upgradeAuthority": "6m2...",
                    "immutable": false,
                    "frozen": false,
                    "lastDeploySlot": 271828182,
                    "lastDeployTs": 1719360000
                  },
                  "label": "Jupiter Aggregator v6",
                  "activity": {
                    "sampled": 1000,
                    "txPerMin": 842.31,
                    "failPct": 4.2,
                    "lastActiveTs": 1719446400,
                    "lowActivity": false
                  },
                  "typeMix": [
                    {
                      "type": "SWAP",
                      "count": 78,
                      "pct": 78
                    },
                    {
                      "type": "UNKNOWN",
                      "count": 22,
                      "pct": 22
                    }
                  ],
                  "recentTxs": [
                    {
                      "type": "SWAP",
                      "description": "Swapped 1 SOL for 162 USDC",
                      "feePayer": "5Q5...",
                      "signature": "3xQ...",
                      "ts": 1719446400,
                      "error": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid program id (not base58"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Program scan unavailable (RPC/enhanced-tx upstream failed) — error \"program scan unavailable\""
          },
          "503": {
            "description": "program provider (Stryke's node layer) not configured"
          }
        }
      }
    },
    "/api/v2/positions/{wallet}": {
      "get": {
        "summary": "DeFi positions",
        "description": "Aggregated DeFi positions across Kamino (lend/borrow), Drift (perp + spot), MarginFi (lend/borrow) and Jupiter Perps, flattened into one normalized position contract. Each protocol is fetched independently and isolated — one failing leg never sinks the others.",
        "tags": [
          "Positions"
        ],
        "operationId": "positions-get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address (base58)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "positions[] of {protocol ('kamino'|'drift'|'marginfi'|'jupiter_perps'), type ('lend'|'borrow'|'perp'), market (human label), sizeUsd (always ≥0, glitch-capped 1e12), pnlUsd (signed; null where the protocol decode can't derive it — Kamino, MarginFi, Drift spot), leverage (number or null; only Jupiter Perps exposes it), healthFactor (Kamino obligation-level only, else null)}. Kamino USD is i128/2^60 fixed-point; Drift/MarginFi are on-chain borsh decodes; Jupiter Perps is public REST. Empty/dust legs are dropped. Cached 300s.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "protocol": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "market": {
                            "type": "string"
                          },
                          "sizeUsd": {
                            "type": "number"
                          },
                          "pnlUsd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "leverage": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "healthFactor": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "wallet": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
                  "count": 3,
                  "positions": [
                    {
                      "protocol": "kamino",
                      "type": "lend",
                      "market": "Main: SOL",
                      "sizeUsd": 12500,
                      "pnlUsd": null,
                      "leverage": null,
                      "healthFactor": 1.84
                    },
                    {
                      "protocol": "drift",
                      "type": "perp",
                      "market": "SOL-PERP",
                      "sizeUsd": 3200,
                      "pnlUsd": -145.22,
                      "leverage": null,
                      "healthFactor": null
                    },
                    {
                      "protocol": "jupiter_perps",
                      "type": "perp",
                      "market": "SOL-PERP",
                      "sizeUsd": 5000,
                      "pnlUsd": 312.5,
                      "leverage": 4.2,
                      "healthFactor": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid wallet address"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Unexpected aggregation failure (individual protocol failures are swallowed and return no rows, not a 502"
          }
        }
      }
    },
    "/api/v2/webhooks": {
      "post": {
        "summary": "Create a webhook",
        "description": "Subscribe an https endpoint to a token's trades. Returns the signing secret ONCE.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-create",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The secret is shown once, in this response, and no route will ever return it again — rotate if it is lost. Verify every delivery: X-Stryke-Signature is `t=<unix seconds>,v1=<hex>`, where v1 is HMAC-SHA256 of `${t}.${rawBody}` under the subscription secret. Sign the RAW request bytes — re-encoding the parsed JSON changes key order and unicode escaping and makes valid signatures fail intermittently. Reject anything whose `t` is more than 300 seconds from now; the timestamp is inside the signature so a captured request cannot be replayed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "filters": {},
                        "active": {
                          "type": "boolean"
                        },
                        "disabledReason": {},
                        "secretFingerprint": {
                          "type": "string"
                        },
                        "consecutiveFailures": {
                          "type": "number"
                        },
                        "lastDeliveryAt": {},
                        "lastError": {},
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    },
                    "secret": {
                      "type": "string"
                    },
                    "secretNote": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "object",
                      "properties": {
                        "header": {
                          "type": "string"
                        },
                        "format": {
                          "type": "string"
                        },
                        "signedMaterial": {
                          "type": "string"
                        },
                        "toleranceSeconds": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "webhook": {
                    "id": 18,
                    "chain": "eth",
                    "kind": "trades",
                    "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                    "url": "https://hooks.yourapp.com/stryke2",
                    "filters": null,
                    "active": true,
                    "disabledReason": null,
                    "secretFingerprint": "73dc0ddad741",
                    "consecutiveFailures": 0,
                    "lastDeliveryAt": null,
                    "lastError": null,
                    "createdAt": "2026-09-07T09:41:38.000Z"
                  },
                  "secret": "whsec_<64 hex characters — shown once, store it now>",
                  "secretNote": "Store this now — it is never shown again. Rotate with POST /api/v2/webhooks/{id}/rotate if it is lost.",
                  "signature": {
                    "header": "X-Stryke-Signature",
                    "format": "t=<unix seconds>,v1=<hex hmac-sha256>",
                    "signedMaterial": "`${t}.${rawRequestBody}` — sign the RAW bytes, not a re-encoded object",
                    "toleranceSeconds": 300
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad address, bad filter, or a URL that is not a public https endpoint"
          },
          "401": {
            "description": "no x-api-key"
          },
          "409": {
            "description": "this key already has a webhook for this chain, token and URL"
          },
          "429": {
            "description": "this key is at its webhook limit"
          },
          "501": {
            "description": "the chain is not covered by the first-party index, or this deployment has no signing key configured"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "description": "A chain the index follows — see GET /api/v2/stream/chains."
                  },
                  "token": {
                    "type": "string",
                    "description": "Token address in the chain's own format."
                  },
                  "url": {
                    "type": "string",
                    "description": "https endpoint to POST to. Must resolve to a public address; private, loopback, link-local and cloud-metadata targets are refused."
                  },
                  "kind": {
                    "type": "string",
                    "description": "'trades' (default and currently the only kind)."
                  },
                  "filters": {
                    "type": "object",
                    "description": "Optional { minAmountUsd, side, commitment }. An unrecognised filter is a 400, never silently ignored. commitment 'confirmed' (Solana only, where enabled) delivers from the confirmed fast lane ~1–3 s after the block instead of the finalized tape (~15 s), with the same eventId the finalized delivery would carry — so dedupe on eventId as always — and sends a `trade.retracted` event (data.retractedEventId) if that trade does not finalize as delivered — data.finalizedEventId names the event that carries it when the same transaction finalized at another position. A token with more than 200,000 trades in 24 h cannot use 'confirmed'."
                  }
                },
                "required": [
                  "chain",
                  "token",
                  "url"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "List your webhooks",
        "description": "Every subscription on this API key. Secrets are never included.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-list",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "token": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "filters": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "minAmountUsd": {
                                "type": "number"
                              }
                            }
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "disabledReason": {},
                          "secretFingerprint": {
                            "type": "string"
                          },
                          "consecutiveFailures": {
                            "type": "number"
                          },
                          "lastDeliveryAt": {},
                          "lastError": {},
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 2,
                  "limit": 25,
                  "webhooks": [
                    {
                      "id": 18,
                      "chain": "eth",
                      "kind": "trades",
                      "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                      "url": "https://hooks.yourapp.com/stryke2",
                      "filters": null,
                      "active": true,
                      "disabledReason": null,
                      "secretFingerprint": "73dc0ddad741",
                      "consecutiveFailures": 0,
                      "lastDeliveryAt": null,
                      "lastError": null,
                      "createdAt": "2026-09-07T09:41:38.000Z"
                    },
                    {
                      "id": 17,
                      "chain": "eth",
                      "kind": "trades",
                      "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                      "url": "https://hooks.yourapp.com/stryke",
                      "filters": {
                        "minAmountUsd": 25000
                      },
                      "active": true,
                      "disabledReason": null,
                      "secretFingerprint": "bfcadac92585",
                      "consecutiveFailures": 0,
                      "lastDeliveryAt": null,
                      "lastError": null,
                      "createdAt": "2026-09-07T09:41:38.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/webhooks/{id}": {
      "get": {
        "summary": "One webhook",
        "description": "A subscription plus its pending/delivered/dead delivery counts.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {
                            "minAmountUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "disabledReason": {},
                        "secretFingerprint": {
                          "type": "string"
                        },
                        "consecutiveFailures": {
                          "type": "number"
                        },
                        "lastDeliveryAt": {},
                        "lastError": {},
                        "createdAt": {
                          "type": "string"
                        },
                        "deliveries": {
                          "type": "object",
                          "properties": {
                            "pending": {
                              "type": "number"
                            },
                            "delivered": {
                              "type": "number"
                            },
                            "dead": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "webhook": {
                    "id": 17,
                    "chain": "eth",
                    "kind": "trades",
                    "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "url": "https://hooks.yourapp.com/stryke",
                    "filters": {
                      "minAmountUsd": 25000
                    },
                    "active": true,
                    "disabledReason": null,
                    "secretFingerprint": "bfcadac92585",
                    "consecutiveFailures": 0,
                    "lastDeliveryAt": null,
                    "lastError": null,
                    "createdAt": "2026-09-07T09:41:38.000Z",
                    "deliveries": {
                      "pending": 1,
                      "delivered": 0,
                      "dead": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "no such webhook on this key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "delete": {
        "summary": "Delete a webhook",
        "description": "Removes the subscription and everything still queued for it.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "patch": {
        "summary": "Enable or disable",
        "description": "Body { \"active\": true|false }. Re-enabling also clears the consecutive-failure count.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-patch",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {
                            "minAmountUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "disabledReason": {
                          "type": "string"
                        },
                        "secretFingerprint": {
                          "type": "string"
                        },
                        "consecutiveFailures": {
                          "type": "number"
                        },
                        "lastDeliveryAt": {},
                        "lastError": {},
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "webhook": {
                    "id": 17,
                    "chain": "eth",
                    "kind": "trades",
                    "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "url": "https://hooks.yourapp.com/stryke",
                    "filters": {
                      "minAmountUsd": 25000
                    },
                    "active": false,
                    "disabledReason": "disabled by owner",
                    "secretFingerprint": "cd61df8cc633",
                    "consecutiveFailures": 0,
                    "lastDeliveryAt": null,
                    "lastError": null,
                    "createdAt": "2026-09-07T09:41:02.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "Whether the subscription should deliver."
                  }
                },
                "required": [
                  "active"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/webhooks/{id}/deliveries": {
      "get": {
        "summary": "Delivery log",
        "description": "The last attempts for this subscription: status, HTTP code, error, and when the next retry is due.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "pending | delivered | dead"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-200, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Payloads are deliberately not returned — this is a health log, not a second copy of the firehose.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "webhookId": {
                      "type": "number"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "pending": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "dead": {
                          "type": "number"
                        }
                      }
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "eventId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "number"
                          },
                          "httpStatus": {},
                          "error": {},
                          "createdAt": {
                            "type": "string"
                          },
                          "deliveredAt": {},
                          "nextAttemptAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "webhookId": 17,
                  "stats": {
                    "pending": 1,
                    "delivered": 0,
                    "dead": 0
                  },
                  "deliveries": [
                    {
                      "id": 3315,
                      "eventId": "c561b3de-9bcd-4624-b7dc-ea6c4ab3bb81",
                      "status": "pending",
                      "attempts": 0,
                      "httpStatus": null,
                      "error": null,
                      "createdAt": "2026-09-07T09:41:38.000Z",
                      "deliveredAt": null,
                      "nextAttemptAt": "2026-09-07T09:41:38.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/webhooks/{id}/test": {
      "post": {
        "summary": "Send a test event",
        "description": "Queues one synthetic event with the same headers and signature as a real one.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-test",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "202, because it is queued rather than delivered. It goes through the real outbox — same signing, same retries, same log — so a successful test proves the real path.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "queued": {
                      "type": "boolean"
                    },
                    "eventId": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "queued": true,
                  "eventId": "22d7bbe5-2237-4831-b17e-6b696fa55807",
                  "hint": "Poll GET /api/v2/webhooks/{id}/deliveries to see the attempt and its result."
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "409": {
            "description": "the webhook is disabled"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/webhooks/{id}/rotate": {
      "post": {
        "summary": "Rotate the signing secret",
        "description": "Issues a new secret and returns it once. The old one stops working immediately.",
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhooks-rotate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rotation is immediate and there is no dual-secret window. Every delivery is signed when it is SENT, not when it is queued, so anything still in the queue — and every retry of something already attempted — goes out under the new secret. Switch your receiver over as soon as this returns.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "webhook": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {
                            "minAmountUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "disabledReason": {},
                        "secretFingerprint": {
                          "type": "string"
                        },
                        "consecutiveFailures": {
                          "type": "number"
                        },
                        "lastDeliveryAt": {
                          "type": "string"
                        },
                        "lastError": {},
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    },
                    "secret": {
                      "type": "string"
                    },
                    "secretNote": {
                      "type": "string"
                    },
                    "rotationNote": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "webhook": {
                    "id": 17,
                    "chain": "eth",
                    "kind": "trades",
                    "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "url": "https://hooks.yourapp.com/stryke",
                    "filters": {
                      "minAmountUsd": 25000
                    },
                    "active": true,
                    "disabledReason": null,
                    "secretFingerprint": "7b19a0e4f2c1",
                    "consecutiveFailures": 0,
                    "lastDeliveryAt": "2026-09-07T09:40:11.000Z",
                    "lastError": null,
                    "createdAt": "2026-09-07T09:31:02.000Z"
                  },
                  "secret": "whsec_<64 hex characters — shown once, store it now>",
                  "secretNote": "Store this now — it is never shown again.",
                  "rotationNote": "Deliveries already in the queue were signed with the previous secret…"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/stream/chains": {
      "get": {
        "summary": "Which chains can be streamed",
        "description": "The chains the first-party index follows, whether each is currently serving, how far behind it is, and how far back its history reaches. No key required.",
        "tags": [
          "Streaming (SSE)"
        ],
        "operationId": "stream-chains",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "transport is always \"sse\". `serving:false` carries the reason — chain_not_indexed, no_cursor, follower_error or status_snapshot_stale. lagSeconds is how far behind the follower is, in seconds, or null when that cannot be established.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/stream/{chain}/token/{address}/trades": {
      "get": {
        "summary": "Live trade tape (SSE)",
        "description": "Every swap touching this token, pushed as it lands, read from the first-party tape.",
        "tags": [
          "Streaming (SSE)"
        ],
        "operationId": "stream-trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A chain the index follows — see GET /api/v2/stream/chains"
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Resume position, `<tsMs>-<block>-<logIndex>`. A browser EventSource sends this automatically as Last-Event-ID."
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "buy or sell"
          },
          {
            "name": "minUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only trades at or above this USD size"
          },
          {
            "name": "pool",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only this pool's trades"
          },
          {
            "name": "commitment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "finalized (default) or confirmed. confirmed (Solana only, where enabled) pushes from the confirmed lane ~1–3 s after the block, at-most-once, with NO resume (Last-Event-ID is ignored) and `retract` events for trades that do not finalize."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream. Events: `open` (once, with the resume position and cadence), `trade` (one swap; `id` is the cursor to resume from), `idle` (nothing new since the last poll — this is how you tell a quiet market from a wedged stream), `truncated` (the cursor was older than the resume window and events were skipped — it names the gap rather than silently jumping), `error`, `close`. Comment frames (`: heartbeat`) keep proxies from closing an idle connection and are invisible to an event handler.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid address or interval"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "too many concurrent streams for this key"
          },
          "501": {
            "description": "the index does not follow this chain"
          },
          "503": {
            "description": "the index is not currently serving"
          }
        }
      }
    },
    "/api/v2/stream/{chain}/token/{address}/candles": {
      "get": {
        "summary": "Live OHLCV (SSE)",
        "description": "The token's candles, pushed as they form and again as the open bucket moves.",
        "tags": [
          "Streaming (SSE)"
        ],
        "operationId": "stream-candles",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A chain the index follows"
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Seconds: 60, 300, 900, 3600, 14400 or 86400. Default 60."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Resume position; also accepted as Last-Event-ID."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Each `candle` event carries `final`. false means the bucket is still open and this is an UPDATE of a bar you have already seen — replace it. true means the bucket has closed and will not change — append it. The cursor deliberately does not advance past an open bucket, so a reconnect always sees that bucket's final form.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid address or interval"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "too many concurrent streams for this key"
          },
          "501": {
            "description": "the index does not follow this chain"
          },
          "503": {
            "description": "the index is not currently serving"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}": {
      "get": {
        "summary": "Token summary (any chain)",
        "description": "Price, market cap, liquidity, 24h volume, holder count, logo and socials for a token on any chain the catalog serves. Requires the `market` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "decimals": {
                          "type": "number"
                        },
                        "logo": {
                          "type": "string"
                        },
                        "priceUsd": {
                          "type": "number"
                        },
                        "priceNative": {
                          "type": "number"
                        },
                        "marketCap": {
                          "type": "number"
                        },
                        "fdv": {
                          "type": "number"
                        },
                        "liquidityUsd": {
                          "type": "number"
                        },
                        "volume24h": {
                          "type": "number"
                        },
                        "change24h": {
                          "type": "number"
                        },
                        "trades24h": {
                          "type": "number"
                        },
                        "holders": {
                          "type": "number"
                        },
                        "totalSupply": {
                          "type": "number"
                        },
                        "circulatingSupply": {
                          "type": "number"
                        },
                        "athUsd": {
                          "type": "number"
                        },
                        "atlUsd": {
                          "type": "number"
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "deployer": {
                          "type": "string"
                        },
                        "socials": {
                          "type": "object",
                          "properties": {
                            "twitter": {},
                            "website": {
                              "type": "string"
                            },
                            "telegram": {},
                            "discord": {},
                            "github": {}
                          }
                        },
                        "description": {},
                        "concentration": {
                          "type": "object",
                          "properties": {
                            "top10Pct": {
                              "type": "number"
                            },
                            "top50Pct": {
                              "type": "number"
                            },
                            "top100Pct": {
                              "type": "number"
                            },
                            "top200Pct": {
                              "type": "number"
                            }
                          }
                        },
                        "cohorts": {
                          "type": "object",
                          "properties": {
                            "insiders": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "number"
                                },
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            },
                            "bundlers": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "number"
                                },
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            },
                            "snipers": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "number"
                                },
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            },
                            "proTraders": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "number"
                                },
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            },
                            "freshTraders": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "number"
                                },
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            },
                            "dev": {
                              "type": "object",
                              "properties": {
                                "holdingsPct": {
                                  "type": "number"
                                }
                              }
                            }
                          }
                        },
                        "bonded": {
                          "type": "boolean"
                        },
                        "bondingPct": {
                          "type": "number"
                        },
                        "lastTradeAt": {
                          "type": "number"
                        },
                        "pool": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "dex": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "counter": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                },
                                "priceUsd": {
                                  "type": "number"
                                }
                              }
                            },
                            "liquidityUsd": {
                              "type": "number"
                            },
                            "volume24h": {
                              "type": "number"
                            },
                            "createdAt": {
                              "type": "number"
                            },
                            "lastTradeAt": {
                              "type": "number"
                            },
                            "lpBurnedPct": {}
                          }
                        },
                        "subjectSide": {
                          "type": "string"
                        },
                        "volumeScope": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": {
                    "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "chainId": "evm:1",
                    "symbol": "ETH",
                    "name": "Ethereum",
                    "decimals": 18,
                    "logo": "https://metadata.marketData.io/assets/logos/evm_1_0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.webp",
                    "priceUsd": 2236.931994898836,
                    "priceNative": 2236.931994898836,
                    "marketCap": 273388974639.69992,
                    "fdv": 289601069927.8374,
                    "liquidityUsd": 9480039.763581343,
                    "volume24h": 22063683.404981427,
                    "change24h": -0.2692811407425259,
                    "trades24h": 10859,
                    "holders": 3330187,
                    "totalSupply": 129463511,
                    "circulatingSupply": 122216042,
                    "athUsd": 2803.208637431108,
                    "atlUsd": 2187.461207688246,
                    "createdAt": 1636926269034,
                    "deployer": "0xcefb7853d53b0c20405a3b67773a25b13c6f20c4",
                    "socials": {
                      "twitter": null,
                      "website": "https://weth.io/",
                      "telegram": null,
                      "discord": null,
                      "github": null
                    },
                    "description": null,
                    "concentration": {
                      "top10Pct": 5.012791765084533,
                      "top50Pct": 9.099406778847085,
                      "top100Pct": 11.501348576099621,
                      "top200Pct": 14.26923321696697
                    },
                    "cohorts": {
                      "insiders": {
                        "count": 14,
                        "holdingsPct": 0.4647634765001301
                      },
                      "bundlers": {
                        "count": 53,
                        "holdingsPct": 2.4898824463205056
                      },
                      "snipers": {
                        "count": 12,
                        "holdingsPct": 0.5739134942214927
                      },
                      "proTraders": {
                        "count": 0,
                        "holdingsPct": 0
                      },
                      "freshTraders": {
                        "count": 0,
                        "holdingsPct": 0
                      },
                      "dev": {
                        "holdingsPct": 0
                      }
                    },
                    "bonded": false,
                    "bondingPct": 0,
                    "lastTradeAt": 1794138575000,
                    "pool": {
                      "address": "0xe0554a476a092703abdb3ef35c80e0d76d32939f",
                      "dex": "Uniswap",
                      "type": "uniswap-v3",
                      "counter": {
                        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                        "symbol": "USDC",
                        "priceUsd": 1
                      },
                      "liquidityUsd": 9480039.763581343,
                      "volume24h": 22063683.404981427,
                      "createdAt": 1636926269034,
                      "lastTradeAt": 1794138575000,
                      "lpBurnedPct": null
                    },
                    "subjectSide": "base",
                    "volumeScope": "largest_pool"
                  },
                  "source": {
                    "provider": "market-data",
                    "endpoint": "market/details"
                  },
                  "freshness": {
                    "observedAt": 1794138600577,
                    "dataAt": 1794138575000,
                    "ageMs": 25577,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/price": {
      "get": {
        "summary": "Token price (any chain)",
        "description": "USD price with 24h change, market cap and liquidity where the provider carries them. Requires the `price` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_price",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "priceUsd": {
                          "type": "number"
                        },
                        "priceNative": {
                          "type": "number"
                        },
                        "change24h": {
                          "type": "number"
                        },
                        "change1h": {
                          "type": "number"
                        },
                        "marketCap": {},
                        "fdv": {
                          "type": "number"
                        },
                        "liquidityUsd": {
                          "type": "number"
                        },
                        "volume24h": {
                          "type": "number"
                        },
                        "trades24h": {
                          "type": "number"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "logo": {},
                        "decimals": {
                          "type": "number"
                        },
                        "pool": {
                          "type": "string"
                        },
                        "lastTradeAt": {
                          "type": "number"
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "confidenceBasis": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": {
                    "priceUsd": 2240.0357407721885,
                    "priceNative": 1,
                    "change24h": 0.08375070808122054,
                    "change1h": 0.5086841461727554,
                    "marketCap": null,
                    "fdv": 4647755756.58164,
                    "liquidityUsd": 1300724260.081793,
                    "volume24h": 108944986.95246975,
                    "trades24h": 92999,
                    "symbol": "WETH",
                    "name": "Wrapped Ether",
                    "logo": null,
                    "decimals": 18,
                    "pool": "0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8",
                    "lastTradeAt": 1794138575000,
                    "confidence": 0.878,
                    "confidenceBasis": "samples:3"
                  },
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_swap+idx_pool"
                  },
                  "freshness": {
                    "observedAt": 1794138600684,
                    "dataAt": 1794138575000,
                    "ageMs": 25684,
                    "stale": false
                  },
                  "degraded": [
                    "depth_filtered:32"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/ohlcv": {
      "get": {
        "summary": "OHLCV candles (any chain)",
        "description": "Ascending [{t,o,h,l,c,v}] candles for the token's deepest pool. Requires the `ohlcv` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_ohlcv",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "1m, 5m, 15m, 30m, 1h (default), 4h, 12h, 1d or 1w."
          },
          {
            "name": "timeframe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "minute|hour|day, paired with aggregate. An alternative to period."
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Multiplier for timeframe (e.g. timeframe=minute&aggregate=5). 1-1000, default 1."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-1000, default 100."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Window start: unix seconds, unix ms or ISO-8601."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Window end, same formats."
          },
          {
            "name": "pool",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Price a specific pool instead of the deepest one."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "t": {
                            "type": "number"
                          },
                          "o": {
                            "type": "number"
                          },
                          "h": {
                            "type": "number"
                          },
                          "l": {
                            "type": "number"
                          },
                          "c": {
                            "type": "number"
                          },
                          "v": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": [
                    {
                      "t": 1794128400000,
                      "o": 2242.12223313025,
                      "h": 2250.5876570290693,
                      "l": 2219.4246922824427,
                      "c": 2242.1355378760672,
                      "v": 4227491.542512812
                    },
                    {
                      "t": 1794132000000,
                      "o": 2242.1350039103363,
                      "h": 2245.9156801028275,
                      "l": 2220.819080663823,
                      "c": 2242.1305073767094,
                      "v": 2711367.176393951
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_candle:3600"
                  },
                  "freshness": {
                    "observedAt": 1794138600689,
                    "dataAt": 1794135600000,
                    "ageMs": 3000689,
                    "stale": true
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/price-at": {
      "get": {
        "summary": "Price at a point in time",
        "description": "What this token was worth on a given day, or at a given instant. The question every tax tool, accounting integration and backtest asks first.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_price_at",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD (UTC). Resolves to that calendar day's CLOSE."
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A unix timestamp in ms or an ISO-8601 instant. Resolves to the bar it falls in."
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "With `at`: 60 (default) or 3600 seconds."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "PASS date OR at, NEVER BOTH — they are different questions, and answering one with the other is how a tax figure ends up a day out. The answer reads a stored CANDLE, not a spot row: idx_token_price keeps one mutable row per token and has no history, so a candle is the only thing that gives the same answer twice. If the token did not trade in the exact bucket, the last bucket it did trade in is used, `bucketsBack` says how far back that was, and `degraded` carries resolved_to_earlier_bucket:<n> — so a caller can decide whether a three-day-old close is good enough.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "requested": {
                      "type": "string"
                    },
                    "resolved": {
                      "type": "string"
                    },
                    "bucketsBack": {
                      "type": "number"
                    },
                    "intervalS": {
                      "type": "number"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "priceUsd": {
                          "type": "number"
                        },
                        "open": {
                          "type": "number"
                        },
                        "high": {
                          "type": "number"
                        },
                        "low": {
                          "type": "number"
                        },
                        "close": {
                          "type": "number"
                        },
                        "volumeUsd": {
                          "type": "number"
                        },
                        "trades": {
                          "type": "number"
                        },
                        "basis": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "requested": "2026-11-06T00:00:00.000Z",
                  "resolved": "2026-11-06T00:00:00.000Z",
                  "bucketsBack": 0,
                  "intervalS": 86400,
                  "data": {
                    "priceUsd": 2214.124201446867,
                    "open": 2238.877406842627,
                    "high": 2318.752293470906,
                    "low": 2200.0563441596196,
                    "close": 2214.124201446867,
                    "volumeUsd": 229307793.96045184,
                    "trades": 133595,
                    "basis": "daily-close"
                  },
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_candle"
                  },
                  "freshness": {
                    "observedAt": 1794138600696,
                    "dataAt": 1793923200000,
                    "ageMs": 215400696,
                    "stale": true
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "neither or both of date/at, a malformed date, or a time in the future"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "no candle within the lookback window (7 daily or 60 intraday buckets) — the message names the range the index DOES hold, so a token that never traded is distinguishable from a date the history does not reach"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "the chain is not covered by the first-party index"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/trades": {
      "get": {
        "summary": "Recent trades (any chain)",
        "description": "The live tape for the token's deepest pool: [{ts,type,priceUsd,amountToken,amountUsd,trader,txHash,pool}]. Requires the `trades` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ts": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "amountToken": {
                            "type": "number"
                          },
                          "amountUsd": {
                            "type": "number"
                          },
                          "trader": {
                            "type": "string"
                          },
                          "txHash": {
                            "type": "string"
                          },
                          "pool": {
                            "type": "string"
                          },
                          "counter": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              }
                            }
                          },
                          "operation": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "feesUsd": {},
                          "labels": {
                            "type": "array",
                            "items": {}
                          },
                          "block": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": [
                    {
                      "ts": 1794138575000,
                      "type": "sell",
                      "priceUsd": 2240.0357407721885,
                      "amountToken": 0.000213,
                      "amountUsd": 0.4771276127844762,
                      "trader": "0xf732fa3f8e5aa0b10577f486ddcb56489de03295",
                      "txHash": "0xb8586b4121d11f23c5535d46cdd3ce9f13a587a246a2b956d620ce1a915908a9",
                      "pool": "0x5e3dac6101b9d922d440cc807acf0fcc2572355e",
                      "counter": {
                        "address": "0x0ca7244f798765de51a2b911f16ebcb7367362d1",
                        "symbol": "BMC"
                      },
                      "operation": "swap",
                      "platform": "uniswap-v2",
                      "feesUsd": null,
                      "labels": [],
                      "block": 26369960
                    },
                    {
                      "ts": 1794138575000,
                      "type": "buy",
                      "priceUsd": 2240.0357407721885,
                      "amountToken": 0.025640246750267763,
                      "amountUsd": 57.43506912281775,
                      "trader": "0xf86486442a1875a0ceabfd7add21a58c578553a6",
                      "txHash": "0x653ebd81b8a79bd207c0f7cb5c9edc3387358a85bb45e4bd322071749143d295",
                      "pool": "0x360acf12e72044ba3eaaa654e51e4725c699dcb1",
                      "counter": {
                        "address": "0x6985884c4392d348587b19cb9eaaf157f13271cd",
                        "symbol": "ZRO"
                      },
                      "operation": "swap",
                      "platform": "uniswap-v3",
                      "feesUsd": null,
                      "labels": [],
                      "block": 26369960
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_swap+idx_pool"
                  },
                  "freshness": {
                    "observedAt": 1794138600703,
                    "dataAt": 1794138575000,
                    "ageMs": 25703,
                    "stale": false
                  },
                  "degraded": [
                    "trade_price_from_spot:2"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/pools": {
      "get": {
        "summary": "Pools / pairs (any chain)",
        "description": "Every pool the token trades in, deepest first: [{pool,dex,quoteSymbol,liquidityUsd,volume24h,priceUsd,createdAt}]. Requires the `pools` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_pools",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-100, default 20."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pool": {
                            "type": "string"
                          },
                          "dex": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "quoteSymbol": {
                            "type": "string"
                          },
                          "quoteAddress": {
                            "type": "string"
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "volume24h": {},
                          "trades24h": {},
                          "priceUsd": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lastTradeAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lpBurnedPct": {},
                          "bonded": {},
                          "subjectSide": {
                            "type": "string"
                          },
                          "side": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": [
                    {
                      "pool": "0xa154efaea1c86f8d918fef7e4bbdae2ecbfed76c",
                      "dex": "uniswap-v3",
                      "type": "uniswap-v3",
                      "quoteSymbol": "BRUNK",
                      "quoteAddress": "0xaa1f7832127537a350d37e12760f89babea3903d",
                      "liquidityUsd": 223905366.933591,
                      "volume24h": null,
                      "trades24h": null,
                      "priceUsd": 2240.0357407721885,
                      "createdAt": 1794137735000,
                      "lastTradeAt": 1794138023000,
                      "lpBurnedPct": null,
                      "bonded": null,
                      "subjectSide": "quote",
                      "side": "quote",
                      "name": "BRUNK / WETH"
                    },
                    {
                      "pool": "0xe24b430952bdb793b0e6753d14c4fec9b8a41813",
                      "dex": "v2-other",
                      "type": "v2-other",
                      "quoteSymbol": "UNI",
                      "quoteAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
                      "liquidityUsd": 144773879.991156,
                      "volume24h": null,
                      "trades24h": null,
                      "priceUsd": 2240.0357407721885,
                      "createdAt": null,
                      "lastTradeAt": null,
                      "lpBurnedPct": null,
                      "bonded": null,
                      "subjectSide": "quote",
                      "side": "quote",
                      "name": "UNI / WETH"
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_pool+idx_swap"
                  },
                  "freshness": {
                    "observedAt": 1794138600741,
                    "dataAt": 1794138023000,
                    "ageMs": 577741,
                    "stale": true
                  },
                  "degraded": [
                    "pool_activity_unavailable:sample_capped",
                    "pool_price_from_token_aggregate:2/2"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/holders": {
      "get": {
        "summary": "Holder distribution (any chain)",
        "description": "Holder count, top holders and concentration (top10/50/100), plus sniper/bundler/insider counts where the provider computes them. Requires the `holders` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_holders",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        },
                        "top": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "balance": {
                                "type": "number"
                              },
                              "valueUsd": {
                                "type": "number"
                              },
                              "pct": {
                                "type": "number"
                              },
                              "label": {
                                "type": "string"
                              },
                              "labels": {
                                "type": "array",
                                "items": {}
                              },
                              "entityType": {
                                "type": "string"
                              },
                              "buys": {
                                "type": "number"
                              },
                              "sells": {
                                "type": "number"
                              },
                              "realizedPnlUsd": {
                                "type": "number"
                              },
                              "lastActivityAt": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "concentration": {
                          "type": "object",
                          "properties": {
                            "top10Pct": {
                              "type": "number"
                            },
                            "top50Pct": {
                              "type": "number"
                            },
                            "top100Pct": {
                              "type": "number"
                            },
                            "top200Pct": {
                              "type": "number"
                            }
                          }
                        },
                        "insiders": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "holdingsPct": {
                              "type": "number"
                            }
                          }
                        },
                        "snipers": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "holdingsPct": {
                              "type": "number"
                            }
                          }
                        },
                        "bundlers": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "holdingsPct": {
                              "type": "number"
                            }
                          }
                        },
                        "dev": {
                          "type": "object",
                          "properties": {
                            "holdingsPct": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": {
                    "count": 3330187,
                    "top": [
                      {
                        "address": "0x4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8",
                        "balance": 323360.99483224796,
                        "valueUsd": 723336555.2425725,
                        "pct": 0.24976998718368448,
                        "label": "Aave",
                        "labels": [],
                        "entityType": "lending-decentralized",
                        "buys": 0,
                        "sells": 0,
                        "realizedPnlUsd": 0,
                        "lastActivityAt": 1794138275000
                      },
                      {
                        "address": "0xf04a5cc80b1e94c69b48f5ee68a08cd2f09a7c3e",
                        "balance": 293293.69890342,
                        "valueUsd": 656078058.9792858,
                        "pct": 0.2265454541113287,
                        "label": "sky (makerdao)",
                        "labels": [],
                        "entityType": "cdp",
                        "buys": 0,
                        "sells": 0,
                        "realizedPnlUsd": 0,
                        "lastActivityAt": 1793894411000
                      }
                    ],
                    "concentration": {
                      "top10Pct": 5.012791765084533,
                      "top50Pct": 9.099406778847085,
                      "top100Pct": 11.501348576099621,
                      "top200Pct": 14.26923321696697
                    },
                    "insiders": {
                      "count": 14,
                      "holdingsPct": 0.4647634765001301
                    },
                    "snipers": {
                      "count": 12,
                      "holdingsPct": 0.5739134942214927
                    },
                    "bundlers": {
                      "count": 53,
                      "holdingsPct": 2.4898824463205056
                    },
                    "dev": {
                      "holdingsPct": 0
                    }
                  },
                  "source": {
                    "provider": "market-data",
                    "endpoint": "token/holder-positions+token/details"
                  },
                  "freshness": {
                    "observedAt": 1794138600877,
                    "dataAt": 1794138275000,
                    "ageMs": 325877,
                    "stale": false
                  },
                  "degraded": [
                    "provider_fallback:stryke→market-data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/security": {
      "get": {
        "summary": "Token security (any chain)",
        "description": "Honeypot verdict, buy/sell tax, mint/freeze authority, ownership renouncement, proxy, LP lock/burn and a 0-100 score where HIGHER IS SAFER. Requires the `security` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_security",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "analysed": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": "string"
                        },
                        "honeypot": {
                          "type": "boolean"
                        },
                        "buyTax": {
                          "type": "number"
                        },
                        "sellTax": {
                          "type": "number"
                        },
                        "mintable": {
                          "type": "boolean"
                        },
                        "freezable": {
                          "type": "boolean"
                        },
                        "ownerRenounced": {},
                        "proxy": {
                          "type": "boolean"
                        },
                        "lpLocked": {},
                        "lpBurnedPct": {},
                        "flags": {
                          "type": "array",
                          "items": {}
                        },
                        "score": {
                          "type": "number"
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "trusted": {
                              "type": "boolean"
                            },
                            "openSource": {
                              "type": "boolean"
                            },
                            "transferTax": {},
                            "name": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "holderCount": {
                              "type": "number"
                            },
                            "ownerAddress": {},
                            "creatorAddress": {
                              "type": "string"
                            },
                            "ownerPct": {
                              "type": "number"
                            },
                            "creatorPct": {
                              "type": "number"
                            },
                            "cexListed": {},
                            "cex": {
                              "type": "array",
                              "items": {}
                            },
                            "dexListed": {
                              "type": "boolean"
                            },
                            "lp": {
                              "type": "object",
                              "properties": {
                                "known": {
                                  "type": "boolean"
                                },
                                "lockedPct": {},
                                "burnedPct": {},
                                "holderCount": {},
                                "top": {
                                  "type": "array",
                                  "items": {}
                                },
                                "dex": {
                                  "type": "array",
                                  "items": {}
                                }
                              }
                            },
                            "flagDetails": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": {
                    "analysed": true,
                    "status": "trusted",
                    "honeypot": false,
                    "buyTax": 0,
                    "sellTax": 0,
                    "mintable": false,
                    "freezable": false,
                    "ownerRenounced": null,
                    "proxy": false,
                    "lpLocked": null,
                    "lpBurnedPct": null,
                    "flags": [],
                    "score": 100,
                    "details": {
                      "trusted": true,
                      "openSource": true,
                      "transferTax": null,
                      "name": "Wrapped Ether",
                      "symbol": "WETH",
                      "holderCount": 3696176,
                      "ownerAddress": null,
                      "creatorAddress": "0x4f26ffbe5f04ed43630fdc30a87638d53d0b0876",
                      "ownerPct": 0,
                      "creatorPct": 0,
                      "cexListed": null,
                      "cex": [],
                      "dexListed": true,
                      "lp": {
                        "known": false,
                        "lockedPct": null,
                        "burnedPct": null,
                        "holderCount": null,
                        "top": [],
                        "dex": []
                      },
                      "flagDetails": []
                    }
                  },
                  "source": {
                    "provider": "security",
                    "endpoint": "token_security/1"
                  },
                  "freshness": {
                    "observedAt": 1794138601134,
                    "dataAt": 1794138601133,
                    "ageMs": 1,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/metadata": {
      "get": {
        "summary": "Token metadata (any chain)",
        "description": "Name, symbol, decimals, logo, description, socials, categories, deployer and creation time. Requires the `metadata` capability.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_metadata",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "id": {},
                        "name": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "decimals": {
                          "type": "number"
                        },
                        "logo": {
                          "type": "string"
                        },
                        "description": {},
                        "website": {},
                        "socials": {
                          "type": "object",
                          "properties": {
                            "twitter": {},
                            "website": {},
                            "discord": {},
                            "telegram": {},
                            "github": {}
                          }
                        },
                        "categories": {
                          "type": "array",
                          "items": {}
                        },
                        "rank": {},
                        "deployer": {},
                        "source": {
                          "type": "string"
                        },
                        "listedAt": {},
                        "createdAt": {},
                        "totalSupply": {
                          "type": "number"
                        },
                        "circulatingSupply": {},
                        "maxSupply": {},
                        "investors": {
                          "type": "array",
                          "items": {}
                        },
                        "distribution": {
                          "type": "array",
                          "items": {}
                        },
                        "cexCount": {},
                        "deployments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "chain": {
                                "type": "string"
                              },
                              "decimals": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "pairIndexListed": {}
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "data": {
                    "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "id": null,
                    "name": "Wrapped Ether",
                    "symbol": "WETH",
                    "decimals": 18,
                    "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
                    "description": null,
                    "website": null,
                    "socials": {
                      "twitter": null,
                      "website": null,
                      "discord": null,
                      "telegram": null,
                      "github": null
                    },
                    "categories": [],
                    "rank": null,
                    "deployer": null,
                    "source": "stryke-index",
                    "listedAt": null,
                    "createdAt": null,
                    "totalSupply": 2074857.856946273,
                    "circulatingSupply": null,
                    "maxSupply": null,
                    "investors": [],
                    "distribution": [],
                    "cexCount": null,
                    "deployments": [
                      {
                        "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                        "chain": "eth",
                        "decimals": 18
                      }
                    ],
                    "pairIndexListed": null
                  },
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_token"
                  },
                  "freshness": {
                    "observedAt": 1794138601170,
                    "dataAt": 1790079306000,
                    "ageMs": 4059295170,
                    "stale": true
                  },
                  "degraded": [
                    "no_editorial_fields"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/address/{address}": {
      "get": {
        "summary": "What is this address?",
        "description": "Classifies an address as a token mint, a market (pool) or a wallet, from Stryke's own index — no third-party call. Returns `kind` plus whichever of `token`, `pool` or `wallet` applies. `kind:\"unknown\"` means the address is not in the index, which is NOT a statement that it does not exist on chain; `checked` names the tables that were searched.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_address_address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token address in the chain's own format: 0x… on EVM, base58 on Solana, a Move coin type (0x…::module::Type) on Sui and Aptos. Validated before any provider is called; a mismatch is a 400 that names the expected format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/token/{address}/allowances": {
      "get": {
        "summary": "ERC-20 approvals for a wallet",
        "description": "How much of this token an owner has approved each spender to move. The primitive behind every revoke tool.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_token_address_allowances",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ERC-20 token contract."
          },
          {
            "name": "owner",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The wallet whose approvals you are reading."
          },
          {
            "name": "spenders",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated spender addresses, at most 25. ERC-20 cannot be asked \"who holds an approval\" — allowance() answers about one pair and the token publishes no list — so the spenders come from you."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "One row per spender: {spender, decimals, raw, allowance}. `raw` is the uint256 in the token's own smallest units AS A STRING — never a float. A null `raw` means the call did not return a uint256, which happens when the contract has no allowance() and falls through to a payable fallback (WETH does exactly this): that is NOT an allowance of zero, and treating it as one would be the safest-sounding wrong answer here.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "address": {
                      "type": "string"
                    },
                    "owner": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "spender": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "raw": {
                            "type": "string"
                          },
                          "allowance": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "owner": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": [
                    {
                      "spender": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                      "decimals": 18,
                      "raw": "0",
                      "allowance": "0"
                    },
                    {
                      "spender": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
                      "decimals": 18,
                      "raw": "0",
                      "allowance": "0"
                    }
                  ],
                  "source": {
                    "provider": "evmrpc",
                    "endpoint": "eth_call allowance(address,address)"
                  },
                  "freshness": {
                    "observedAt": 1794138601209,
                    "dataAt": 1794138601209,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "invalid address, missing owner/spenders, or more than 25 spenders"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "the chain is not EVM or has no verified RPC endpoint"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/tokens/prices": {
      "post": {
        "summary": "Batch token prices — one chain, or a basket across several",
        "description": "Prices up to 50 tokens in one call. With a named chain the body is a plain array of addresses. With chain=all each entry names its own chain, so a portfolio spanning several chains is ONE request instead of one per chain.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_post_chain_tokens_prices",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "On a named chain this is the usual envelope. On chain=all the body is { success, chains[], requested, priced, data, sources, errors[] }: `data` is keyed \"<chain>:<address>\" because the same address exists on many chains and a bare address key would collide. A CHAIN THAT FAILS DOES NOT FAIL THE BASKET — its reason lands in errors[] and everything else still prices, which is the only useful behaviour for a batch. `sources` names the provider that answered per chain. Groups run concurrently, so a basket costs the slowest chain rather than the sum.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "addresses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
                          "type": "object",
                          "properties": {
                            "priceUsd": {
                              "type": "number"
                            },
                            "priceNative": {
                              "type": "number"
                            },
                            "change24h": {
                              "type": "number"
                            },
                            "change1h": {
                              "type": "number"
                            },
                            "marketCap": {},
                            "fdv": {
                              "type": "number"
                            },
                            "liquidityUsd": {
                              "type": "number"
                            },
                            "volume24h": {
                              "type": "number"
                            },
                            "trades24h": {
                              "type": "number"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "logo": {},
                            "decimals": {
                              "type": "number"
                            },
                            "pool": {
                              "type": "string"
                            },
                            "lastTradeAt": {
                              "type": "number"
                            },
                            "confidence": {
                              "type": "number"
                            },
                            "confidenceBasis": {
                              "type": "string"
                            }
                          }
                        },
                        "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": {
                          "type": "object",
                          "properties": {
                            "priceUsd": {
                              "type": "number"
                            },
                            "priceNative": {
                              "type": "number"
                            },
                            "change24h": {
                              "type": "number"
                            },
                            "change1h": {
                              "type": "number"
                            },
                            "marketCap": {},
                            "fdv": {
                              "type": "number"
                            },
                            "liquidityUsd": {
                              "type": "number"
                            },
                            "volume24h": {
                              "type": "number"
                            },
                            "trades24h": {
                              "type": "number"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "logo": {},
                            "decimals": {
                              "type": "number"
                            },
                            "pool": {
                              "type": "string"
                            },
                            "lastTradeAt": {
                              "type": "number"
                            },
                            "confidence": {
                              "type": "number"
                            },
                            "confidenceBasis": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "addresses": [
                    "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
                  ],
                  "data": {
                    "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
                      "priceUsd": 2240.0357407721885,
                      "priceNative": 1,
                      "change24h": 0.08375070808122054,
                      "change1h": 0.5086841461727554,
                      "marketCap": null,
                      "fdv": 4647755756.58164,
                      "liquidityUsd": 1300724260.081793,
                      "volume24h": 108944986.95246975,
                      "trades24h": 92999,
                      "symbol": "WETH",
                      "name": "Wrapped Ether",
                      "logo": null,
                      "decimals": 18,
                      "pool": "0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8",
                      "lastTradeAt": 1794138575000,
                      "confidence": 0.878,
                      "confidenceBasis": "samples:3"
                    },
                    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": {
                      "priceUsd": 1.001194016287089,
                      "priceNative": 0.00044698094149308914,
                      "change24h": 0.11940162870889282,
                      "change1h": 0.0060311233764931416,
                      "marketCap": null,
                      "fdv": 49630609716.06576,
                      "liquidityUsd": 660001961.6528839,
                      "volume24h": 160760564.96846983,
                      "trades24h": 39945,
                      "symbol": "USDC",
                      "name": "USD Coin",
                      "logo": null,
                      "decimals": 6,
                      "pool": "2b21c65d9a7dc6926ee330a1c6e5a8037fd81774f3dc066536f800128e39f634",
                      "lastTradeAt": 1794138575000,
                      "confidence": 0.881,
                      "confidenceBasis": "stable-pair"
                    }
                  },
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_swap+idx_pool"
                  },
                  "freshness": {
                    "observedAt": 1794138601275,
                    "dataAt": 1794138575000,
                    "ageMs": 26275,
                    "stale": false
                  },
                  "degraded": [
                    "depth_filtered:32",
                    "depth_filtered:3"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "addresses[] missing, empty, over 50, not { chain, address } on chain=all, an unknown chain, or an address in the wrong format for its chain; more than 10 distinct chains"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "addresses": {
                    "type": "array",
                    "description": "Up to 50. On a named chain: addresses as strings. On chain=all: objects { chain, address }, spanning at most 10 distinct chains."
                  }
                },
                "required": [
                  "addresses"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/chain/{chain}/search": {
      "get": {
        "summary": "Search tokens on a chain",
        "description": "Token search scoped to one chain, or across every indexed chain with chain=all.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_search",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "2-64 characters."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-100, default 20."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "query": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "logo": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "change24h": {
                            "type": "number"
                          },
                          "marketCap": {},
                          "fdv": {
                            "type": "number"
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "volume24h": {
                            "type": "number"
                          },
                          "holders": {},
                          "rank": {},
                          "pool": {
                            "type": "string"
                          },
                          "dex": {
                            "type": "string"
                          },
                          "type": {},
                          "bonded": {},
                          "createdAt": {
                            "type": "number"
                          },
                          "lastTradeAt": {
                            "type": "number"
                          },
                          "pools": {
                            "type": "number"
                          },
                          "trades24h": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "query": "weth",
                  "data": [
                    {
                      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                      "chainId": "eth",
                      "symbol": "WETH",
                      "name": "Wrapped Ether",
                      "decimals": 18,
                      "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
                      "priceUsd": 2229.2780156811523,
                      "change24h": -0.39689942468237654,
                      "marketCap": null,
                      "fdv": 4625435006.153636,
                      "liquidityUsd": 276146532.416067,
                      "volume24h": 6984794.481922,
                      "holders": null,
                      "rank": null,
                      "pool": "0x4e68ccd3e89f51c3074ca5072bbac773960dfa36",
                      "dex": "uniswap-v3",
                      "type": null,
                      "bonded": null,
                      "createdAt": 1788307200000,
                      "lastTradeAt": 1794138480000,
                      "pools": 8,
                      "trades24h": 17116
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_pair_stat"
                  },
                  "freshness": {
                    "observedAt": 1794138601285,
                    "dataAt": 1794138591000,
                    "ageMs": 10285,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/trending": {
      "get": {
        "summary": "Trending tokens on a chain",
        "description": "Top tokens on the chain by recent volume.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_trending",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-100, default 20."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "logo": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "change24h": {
                            "type": "number"
                          },
                          "change1h": {
                            "type": "number"
                          },
                          "marketCap": {},
                          "fdv": {
                            "type": "number"
                          },
                          "holders": {},
                          "volume24h": {
                            "type": "number"
                          },
                          "volume24hUnfiltered": {
                            "type": "number"
                          },
                          "liquidityUsd": {
                            "type": "number"
                          },
                          "trades24h": {
                            "type": "number"
                          },
                          "makers1h": {
                            "type": "number"
                          },
                          "pools": {
                            "type": "number"
                          },
                          "topPool": {
                            "type": "object",
                            "properties": {
                              "pool": {
                                "type": "string"
                              },
                              "dex": {
                                "type": "string"
                              },
                              "type": {},
                              "quoteSymbol": {
                                "type": "string"
                              },
                              "volume24h": {},
                              "liquidityUsd": {
                                "type": "number"
                              }
                            }
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "lastTradeAt": {
                            "type": "number"
                          },
                          "concentration": {},
                          "cohorts": {}
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "data": [
                    {
                      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                      "chainId": "eth",
                      "symbol": "WETH",
                      "name": "Wrapped Ether",
                      "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
                      "priceUsd": 2229.2780156811523,
                      "change24h": -0.39689942468237654,
                      "change1h": 0.025874515719769394,
                      "marketCap": null,
                      "fdv": 4625435006.153636,
                      "holders": null,
                      "volume24h": 27446723.81035148,
                      "volume24hUnfiltered": 86428182.71653047,
                      "liquidityUsd": 298169223.367967,
                      "trades24h": 30007,
                      "makers1h": 9,
                      "pools": 63,
                      "topPool": {
                        "pool": "0x4e68ccd3e89f51c3074ca5072bbac773960dfa36",
                        "dex": "uniswap-v3",
                        "type": null,
                        "quoteSymbol": "USDT",
                        "volume24h": null,
                        "liquidityUsd": 83406341.874981
                      },
                      "createdAt": 1788307200000,
                      "lastTradeAt": 1794138480000,
                      "concentration": null,
                      "cohorts": null
                    },
                    {
                      "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                      "chainId": "eth",
                      "symbol": "USDC",
                      "name": "USD Coin",
                      "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
                      "priceUsd": 1.0013265141814334,
                      "change24h": 0.03743931413729674,
                      "change1h": 0.01925445075244067,
                      "marketCap": null,
                      "fdv": 49637177824.91922,
                      "holders": null,
                      "volume24h": 23677594.806444142,
                      "volume24hUnfiltered": 23677594.806444142,
                      "liquidityUsd": 60290863.791653,
                      "trades24h": 2129,
                      "makers1h": 25,
                      "pools": 8,
                      "topPool": {
                        "pool": "0x3416cf6c708da44db2624d63ea0aaef7113527c6",
                        "dex": "uniswap-v3",
                        "type": null,
                        "quoteSymbol": "USDT",
                        "volume24h": null,
                        "liquidityUsd": 33010953.18917
                      },
                      "createdAt": 1788307200000,
                      "lastTradeAt": 1794138480000,
                      "concentration": null,
                      "cohorts": null
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_pair_stat"
                  },
                  "freshness": {
                    "observedAt": 1794138601379,
                    "dataAt": 1794138601379,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/screener": {
      "get": {
        "summary": "Screen the chain's tokens",
        "description": "Rank every token on the chain by what it actually did over a window — volume, trade count and price change — with thresholds. This is the \"show me tokens over $50k of volume with more than 200 trades today\" question that /trending cannot answer, because /trending is a fixed ranking and this is a query.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_screener",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "1h, 4h, 24h, 1d or 7d. Default 24h. The window picks the bar size that tiles it: 1h/4h/24h read hourly bars, 1d/7d read daily ones."
          },
          {
            "name": "minVolumeUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Only tokens whose summed USD volume over the window is at least this."
          },
          {
            "name": "minTrades",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Only tokens with at least this many trades over the window."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "volume (default), trades, buckets or recent."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "desc (default) or asc."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rows carry volumeUsd, volumeToken, trades, buckets (how many bars actually had data — fewer than the window implies a token that was quiet or newly listed), open, close, changePct and the first/last bucket timestamps. `source.provider` is always \"stryke\": these numbers are summed from our own tape, not taken from a reseller, which is why there is no ceiling on how many tokens can be ranked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "window": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "intervalS": {
                          "type": "number"
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chain": {
                            "type": "string"
                          },
                          "tokenAddress": {
                            "type": "string"
                          },
                          "volumeUsd": {
                            "type": "number"
                          },
                          "volumeToken": {
                            "type": "number"
                          },
                          "trades": {
                            "type": "number"
                          },
                          "buckets": {
                            "type": "number"
                          },
                          "open": {
                            "type": "number"
                          },
                          "close": {
                            "type": "number"
                          },
                          "changePct": {
                            "type": "number"
                          },
                          "firstBucket": {
                            "type": "string"
                          },
                          "lastBucket": {
                            "type": "string"
                          },
                          "lastBucketMs": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "window": {
                    "name": "24h",
                    "intervalS": 3600,
                    "from": "2026-11-07T11:50:01.383Z",
                    "to": "2026-11-08T11:50:01.383Z"
                  },
                  "count": 3,
                  "data": [
                    {
                      "chain": "eth",
                      "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                      "volumeUsd": 160760564.96846983,
                      "volumeToken": 179855207.30039203,
                      "trades": 39945,
                      "buckets": 24,
                      "open": 1,
                      "close": 1,
                      "changePct": 0,
                      "firstBucket": "2026-11-07T12:00:00Z",
                      "lastBucket": "2026-11-08T11:00:00Z",
                      "lastBucketMs": 1794135600000
                    },
                    {
                      "chain": "eth",
                      "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                      "volumeUsd": 113067261.48916279,
                      "volumeToken": 119209380.20389299,
                      "trades": 29058,
                      "buckets": 24,
                      "open": 0.9999999999999999,
                      "close": 1,
                      "changePct": 1.1102230246251569e-14,
                      "firstBucket": "2026-11-07T12:00:00Z",
                      "lastBucket": "2026-11-08T11:00:00Z",
                      "lastBucketMs": 1794135600000
                    }
                  ],
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_candle"
                  },
                  "freshness": {
                    "observedAt": 1794138601383,
                    "dataAt": 1794135600000,
                    "ageMs": 3001575,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "unknown window, sort or threshold"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "the chain is not covered by the first-party index"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/portfolio": {
      "get": {
        "summary": "Wallet portfolio (any chain, or all)",
        "description": "Token holdings and total USD value for an address. Use chain=all to fetch every chain the provider indexes in one call.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_portfolio",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address in the chain's format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "totalUsd": {
                          "type": "number"
                        },
                        "assetCount": {
                          "type": "number"
                        },
                        "wallets": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "chains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "assets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "symbol": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "logo": {
                                "type": "string"
                              },
                              "priceUsd": {
                                "type": "number"
                              },
                              "change24h": {},
                              "balance": {
                                "type": "number"
                              },
                              "valueUsd": {
                                "type": "number"
                              },
                              "allocationPct": {
                                "type": "number"
                              },
                              "liquidityUsd": {
                                "type": "number"
                              },
                              "realizedPnlUsd": {},
                              "unrealizedPnlUsd": {},
                              "contracts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "address": {
                                      "type": "string"
                                    },
                                    "chainId": {
                                      "type": "string"
                                    },
                                    "balance": {
                                      "type": "number"
                                    },
                                    "decimals": {
                                      "type": "number"
                                    }
                                  }
                                }
                              },
                              "chain": {
                                "type": "string"
                              },
                              "native": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": {
                    "totalUsd": 1452272.007744656,
                    "assetCount": 29,
                    "wallets": [
                      "0x28c6c06298d514db089934071355e5743bf21d60"
                    ],
                    "chains": [
                      "eth"
                    ],
                    "assets": [
                      {
                        "symbol": "USDT",
                        "name": "Tether USD",
                        "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
                        "priceUsd": 0.9988064494724401,
                        "change24h": null,
                        "balance": 1352017.937959,
                        "valueUsd": 1350404.2362358787,
                        "allocationPct": 92.98562728156033,
                        "liquidityUsd": 33010953.18917,
                        "realizedPnlUsd": null,
                        "unrealizedPnlUsd": null,
                        "contracts": [
                          {
                            "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                            "chainId": "1",
                            "balance": 1352017.937959,
                            "decimals": 6
                          }
                        ],
                        "chain": "eth",
                        "native": false
                      },
                      {
                        "symbol": "USDC",
                        "name": "USD Coin",
                        "logo": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
                        "priceUsd": 1.0011878776963705,
                        "change24h": null,
                        "balance": 52363.119552,
                        "valueUsd": 52425.3205338282,
                        "allocationPct": 3.6098830146319134,
                        "liquidityUsd": 33010953.18917,
                        "realizedPnlUsd": null,
                        "unrealizedPnlUsd": null,
                        "contracts": [
                          {
                            "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                            "chainId": "1",
                            "balance": 52363.119552,
                            "decimals": 6
                          }
                        ],
                        "chain": "eth",
                        "native": false
                      }
                    ]
                  },
                  "source": {
                    "provider": "stryke",
                    "endpoint": "idx_token_price+chain_balances"
                  },
                  "freshness": {
                    "observedAt": 1794138600243,
                    "dataAt": 1794138263000,
                    "ageMs": 338578,
                    "stale": true
                  },
                  "degraded": [
                    "incomplete_enumeration:eth"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/trades": {
      "get": {
        "summary": "Wallet trades (any chain)",
        "description": "Every swap this wallet made on this chain, newest first: token in/out, amounts, USD value, price and transaction hash.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ts": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "priceUsd": {
                            "type": "number"
                          },
                          "amountToken": {
                            "type": "number"
                          },
                          "amountUsd": {
                            "type": "number"
                          },
                          "token": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "logo": {
                                "type": "string"
                              },
                              "decimals": {
                                "type": "number"
                              }
                            }
                          },
                          "counter": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "number"
                              }
                            }
                          },
                          "trader": {
                            "type": "string"
                          },
                          "txHash": {
                            "type": "string"
                          },
                          "pool": {
                            "type": "string"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "operation": {
                            "type": "string"
                          },
                          "platform": {},
                          "feesUsd": {
                            "type": "number"
                          },
                          "labels": {
                            "type": "array",
                            "items": {}
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": [
                    {
                      "ts": 1793310210042,
                      "type": "buy",
                      "priceUsd": 1.490875979608764,
                      "amountToken": 0.3000108176,
                      "amountUsd": 0.4472789216508686,
                      "token": {
                        "address": "0x82d24443bfd28bc58a505f5fa75fbcb474e41111",
                        "symbol": "FAI",
                        "name": "Fair 2.0",
                        "logo": "https://metadata.marketData.io/assets/logos/evm_56_0x82d24443bfd28bc58a505f5fa75fbcb474e41111.webp",
                        "decimals": 18
                      },
                      "counter": {
                        "address": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
                        "symbol": "CAKE",
                        "amount": 0.2280523875
                      },
                      "trader": "0x28c6c06298d514db089934071355e5743bf21d60",
                      "txHash": "0xfb1bbe2ae2afe6abf54b88e2ac8ffa1c49031388741f239b56113f354796ed8a",
                      "pool": "0xa96a2bb9775cce45fa0ebf03f6b93708e3d867a7",
                      "chain": "BNB Smart Chain (BEP20)",
                      "operation": "regular",
                      "platform": null,
                      "feesUsd": 0.008973098217295918,
                      "labels": []
                    },
                    {
                      "ts": 1793308127012,
                      "type": "buy",
                      "priceUsd": 47.6961887397091,
                      "amountToken": 0.0200083135,
                      "amountUsd": 0.9543202950507943,
                      "token": {
                        "address": "0x39b58c3930d4352b2e4d8697ea6188c864455555",
                        "symbol": "DAGOU",
                        "name": "大狗币",
                        "logo": "https://metadata.marketData.io/assets/logos/evm_56_0x39b58c3930d4352b2e4d8697ea6188c864455555.webp",
                        "decimals": 18
                      },
                      "counter": {
                        "address": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
                        "symbol": "CAKE",
                        "amount": 0.4897725773
                      },
                      "trader": "0x28c6c06298d514db089934071355e5743bf21d60",
                      "txHash": "0x0f6325fd7772500c3d03a45357732ffb787bef7027f3da0a054a44130c22f45c",
                      "pool": "0x32df7ebbff443425555cb0e22d673e7e34e07a41",
                      "chain": "BNB Smart Chain (BEP20)",
                      "operation": "regular",
                      "platform": null,
                      "feesUsd": 0.00769797918037981,
                      "labels": []
                    }
                  ],
                  "source": {
                    "provider": "market-data",
                    "endpoint": "wallet/trades(v2)"
                  },
                  "freshness": {
                    "observedAt": 1794138601869,
                    "dataAt": 1793310210042,
                    "ageMs": 828391827,
                    "stale": true
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/activity": {
      "get": {
        "summary": "Wallet activity (any chain)",
        "description": "The wallet's full on-chain activity on this chain — transfers in and out, swaps, approvals and contract interactions — with spam filtered out.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_activity",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ts": {
                            "type": "number"
                          },
                          "txHash": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "string"
                          },
                          "block": {
                            "type": "number"
                          },
                          "feeUsd": {
                            "type": "number"
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "model": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "amount": {
                                  "type": "number"
                                },
                                "amountUsd": {
                                  "type": "number"
                                },
                                "asset": {
                                  "type": "object",
                                  "properties": {
                                    "address": {
                                      "type": "string"
                                    },
                                    "symbol": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "decimals": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "from": {
                                  "type": "string"
                                },
                                "to": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": [
                    {
                      "ts": 1794136751000,
                      "txHash": "0xef79071597c099b19cf09d8a2ac4e55747d88fb3b45be64aa8daf8efc7293320",
                      "chainId": "evm:1",
                      "block": 26369808,
                      "feeUsd": 0.004694068377891174,
                      "actions": [
                        {
                          "model": "transfer",
                          "type": "NATIVE_IN",
                          "amount": 0.000001785799038,
                          "amountUsd": 0.003991744187402038,
                          "asset": {
                            "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                            "symbol": "ETH",
                            "name": "Ethereum",
                            "decimals": 18,
                            "priceUsd": 2237.255387003395
                          },
                          "from": "0x2c3347aea08358f82c53116e08bbefe66cd8c8c3",
                          "to": "0x28c6c06298d514db089934071355e5743bf21d60"
                        }
                      ]
                    },
                    {
                      "ts": 1794136739000,
                      "txHash": "0x14a072ffb679fb76aea74683d54a437825bbeb0096c0982882a655dc2a46480f",
                      "chainId": "evm:1",
                      "block": 26369807,
                      "feeUsd": 0.004688574203674748,
                      "actions": [
                        {
                          "model": "transfer",
                          "type": "NATIVE_IN",
                          "amount": 0.000003843803281,
                          "amountUsd": 0.00858188424156998,
                          "asset": {
                            "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                            "symbol": "ETH",
                            "name": "Ethereum",
                            "decimals": 18,
                            "priceUsd": 2237.255387003395
                          },
                          "from": "0x6d0e9dffa2c414fc76a100bff8628a5880cc9681",
                          "to": "0x28c6c06298d514db089934071355e5743bf21d60"
                        }
                      ]
                    }
                  ],
                  "source": {
                    "provider": "market-data",
                    "endpoint": "wallet/activity(v2)"
                  },
                  "freshness": {
                    "observedAt": 1794138601953,
                    "dataAt": 1794136751000,
                    "ageMs": 1850953,
                    "stale": true
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/pnl": {
      "get": {
        "summary": "Wallet PnL (any chain)",
        "description": "Per-token profit and loss for this wallet on this chain: realised and unrealised PnL, average cost basis, amount still held and current value.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_pnl",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "summary": {
                          "type": "object",
                          "properties": {
                            "realizedPnlUsd": {
                              "type": "number"
                            },
                            "unrealizedPnlUsd": {
                              "type": "number"
                            },
                            "totalPnlUsd": {
                              "type": "number"
                            },
                            "feesPaidUsd": {
                              "type": "number"
                            },
                            "winRate": {
                              "type": "number"
                            },
                            "wins": {
                              "type": "number"
                            },
                            "losses": {
                              "type": "number"
                            },
                            "positionCount": {
                              "type": "number"
                            }
                          }
                        },
                        "positions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string"
                              },
                              "chainId": {
                                "type": "string"
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "logo": {
                                "type": "string"
                              },
                              "priceUsd": {
                                "type": "number"
                              },
                              "balance": {
                                "type": "number"
                              },
                              "valueUsd": {
                                "type": "number"
                              },
                              "buys": {
                                "type": "number"
                              },
                              "sells": {
                                "type": "number"
                              },
                              "avgBuyPriceUsd": {
                                "type": "number"
                              },
                              "avgSellPriceUsd": {
                                "type": "number"
                              },
                              "realizedPnlUsd": {
                                "type": "number"
                              },
                              "unrealizedPnlUsd": {
                                "type": "number"
                              },
                              "totalPnlUsd": {
                                "type": "number"
                              },
                              "feesPaidUsd": {
                                "type": "number"
                              },
                              "volumeBuyUsd": {
                                "type": "number"
                              },
                              "volumeSellUsd": {
                                "type": "number"
                              },
                              "firstTradeAt": {
                                "type": "number"
                              },
                              "lastTradeAt": {
                                "type": "number"
                              },
                              "labels": {
                                "type": "array",
                                "items": {}
                              }
                            }
                          }
                        },
                        "wallet": {
                          "type": "object",
                          "properties": {
                            "entity": {
                              "type": "string"
                            },
                            "labels": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "fundedAt": {
                              "type": "number"
                            },
                            "fundedBy": {
                              "type": "string"
                            },
                            "fundedByTag": {}
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": {
                    "summary": {
                      "realizedPnlUsd": 0,
                      "unrealizedPnlUsd": 17188575072839072000,
                      "totalPnlUsd": 17188575072839072000,
                      "feesPaidUsd": 514.81,
                      "winRate": 0.0417,
                      "wins": 4,
                      "losses": 92,
                      "positionCount": 100
                    },
                    "positions": [
                      {
                        "address": "0x2bdb0b766e948675fcdbb531934879535d88eac5",
                        "chainId": "evm:1",
                        "symbol": "SPKL",
                        "name": "SparkLend",
                        "logo": "https://metadata.marketData.io/assets/logos/evm_1_0x2bdb0b766e948675fcdbb531934879535d88eac5.webp",
                        "priceUsd": 0,
                        "balance": 0,
                        "valueUsd": 0,
                        "buys": 1,
                        "sells": 0,
                        "avgBuyPriceUsd": 4.433e-7,
                        "avgSellPriceUsd": 0,
                        "realizedPnlUsd": 0,
                        "unrealizedPnlUsd": 0,
                        "totalPnlUsd": 0,
                        "feesPaidUsd": 1.2503207009,
                        "volumeBuyUsd": 51.6390887371,
                        "volumeSellUsd": 0,
                        "firstTradeAt": 1776920351081,
                        "lastTradeAt": 1776920351081,
                        "labels": []
                      },
                      {
                        "address": "0x7d09a736c5fb1db357de04a07deb22d5829da26f",
                        "chainId": "evm:1",
                        "symbol": "TOGETHER AI",
                        "name": "Together AI",
                        "logo": "https://metadata.marketData.io/assets/logos/evm_1_0x7d09a736c5fb1db357de04a07deb22d5829da26f.webp",
                        "priceUsd": 0,
                        "balance": 323720014.8297545,
                        "valueUsd": 0,
                        "buys": 1,
                        "sells": 0,
                        "avgBuyPriceUsd": 0.0000010441,
                        "avgSellPriceUsd": 0,
                        "realizedPnlUsd": 0,
                        "unrealizedPnlUsd": -337.9960674837467,
                        "totalPnlUsd": -337.9960674837467,
                        "feesPaidUsd": 1.0000039614,
                        "volumeBuyUsd": 337.9885701617,
                        "volumeSellUsd": 0,
                        "firstTradeAt": 1735527419156,
                        "lastTradeAt": 1735527419156,
                        "labels": []
                      }
                    ],
                    "wallet": {
                      "entity": "binance",
                      "labels": [
                        "Hot Wallet"
                      ],
                      "fundedAt": 1619073240000,
                      "fundedBy": "0x00799bbc833d5b168f0410312d2a8fd9e0e3079c",
                      "fundedByTag": null
                    }
                  },
                  "source": {
                    "provider": "market-data",
                    "endpoint": "wallet/positions(v2)"
                  },
                  "freshness": {
                    "observedAt": 1794138602441,
                    "dataAt": 1776920351081,
                    "ageMs": 17218251360,
                    "stale": true
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/risk": {
      "get": {
        "summary": "Wallet risk flags",
        "description": "Whether this ADDRESS is known to be malicious — sanctioned, a phishing or theft address, a mixer, blacklisted, or the deployer of malicious contracts. The token security verb answers the same kind of question about a contract; this one is about the counterparty.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_risk",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The address to screen, in the chain's format."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "THE THREE OUTCOMES ARE DIFFERENT AND YOU MUST BRANCH ON ALL THREE. riskLevel \"none\" with a score of 100 means the address was checked and nothing was found. riskLevel \"unknown\" with score null and status \"not_analysed\" means NOBODY HAS LOOKED — flagsResolved is 0 — and it is not a clearance. Anything else names what was raised in `flags`. Treating unknown as clean is the failure mode this endpoint exists to prevent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string"
                        },
                        "analysed": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": "string"
                        },
                        "flags": {
                          "type": "object",
                          "properties": {
                            "sanctioned": {
                              "type": "boolean"
                            },
                            "stealing_attack": {
                              "type": "boolean"
                            },
                            "phishing_activities": {
                              "type": "boolean"
                            },
                            "money_laundering": {
                              "type": "boolean"
                            },
                            "financial_crime": {
                              "type": "boolean"
                            },
                            "cybercrime": {
                              "type": "boolean"
                            },
                            "blackmail_activities": {
                              "type": "boolean"
                            },
                            "darkweb_transactions": {
                              "type": "boolean"
                            },
                            "honeypot_related_address": {
                              "type": "boolean"
                            },
                            "fake_kyc": {
                              "type": "boolean"
                            },
                            "malicious_mining_activities": {
                              "type": "boolean"
                            },
                            "mixer": {
                              "type": "boolean"
                            },
                            "blacklist_doubt": {
                              "type": "boolean"
                            },
                            "fake_token": {
                              "type": "boolean"
                            },
                            "fake_standard_interface": {
                              "type": "boolean"
                            },
                            "reinit": {
                              "type": "boolean"
                            },
                            "gas_abuse": {
                              "type": "boolean"
                            },
                            "malicious_contract_creator": {
                              "type": "boolean"
                            }
                          }
                        },
                        "riskLevel": {
                          "type": "string"
                        },
                        "score": {
                          "type": "number"
                        },
                        "sources": {
                          "type": "array",
                          "items": {}
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "isContract": {
                              "type": "boolean"
                            },
                            "maliciousContractsCreated": {
                              "type": "number"
                            },
                            "flagDetails": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        },
                        "flagsResolved": {
                          "type": "number"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": {
                    "address": "0x28c6c06298d514db089934071355e5743bf21d60",
                    "analysed": true,
                    "status": "ok",
                    "flags": {
                      "sanctioned": false,
                      "stealing_attack": false,
                      "phishing_activities": false,
                      "money_laundering": false,
                      "financial_crime": false,
                      "cybercrime": false,
                      "blackmail_activities": false,
                      "darkweb_transactions": false,
                      "honeypot_related_address": false,
                      "fake_kyc": false,
                      "malicious_mining_activities": false,
                      "mixer": false,
                      "blacklist_doubt": false,
                      "fake_token": false,
                      "fake_standard_interface": false,
                      "reinit": false,
                      "gas_abuse": false,
                      "malicious_contract_creator": false
                    },
                    "riskLevel": "none",
                    "score": 100,
                    "sources": [],
                    "details": {
                      "isContract": false,
                      "maliciousContractsCreated": 0,
                      "flagDetails": []
                    },
                    "flagsResolved": 18
                  },
                  "source": {
                    "provider": "security",
                    "endpoint": "address_security/1"
                  },
                  "freshness": {
                    "observedAt": 1794138602950,
                    "dataAt": 1794138602950,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "invalid address for this chain"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "the chain has no security coverage"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/defi-positions": {
      "get": {
        "summary": "Wallet DeFi positions (any chain)",
        "description": "Liquidity-pool, lending and staking positions this wallet holds on this chain, with the protocol, the underlying assets and the position's USD value.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_defi_positions",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "totalValueUSD": {
                          "type": "number"
                        },
                        "totalDepositedUSD": {
                          "type": "number"
                        },
                        "totalBorrowedUSD": {
                          "type": "number"
                        },
                        "totalRewardsUSD": {
                          "type": "number"
                        },
                        "protocolCount": {
                          "type": "number"
                        },
                        "protocols": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "protocol": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string"
                                  },
                                  "logo": {
                                    "type": "string"
                                  },
                                  "category": {
                                    "type": "string"
                                  }
                                }
                              },
                              "totalValueUSD": {
                                "type": "string"
                              },
                              "positions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "valueUSD": {
                                      "type": "number"
                                    },
                                    "tokens": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "address": {
                                            "type": "string"
                                          },
                                          "symbol": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "decimals": {
                                            "type": "number"
                                          },
                                          "amountRaw": {
                                            "type": "string"
                                          },
                                          "amountFormatted": {
                                            "type": "number"
                                          },
                                          "priceUSD": {
                                            "type": "number"
                                          },
                                          "valueUSD": {
                                            "type": "number"
                                          }
                                        }
                                      }
                                    },
                                    "metadata": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string"
                                        },
                                        "lstMint": {
                                          "type": "string"
                                        },
                                        "lstSymbol": {
                                          "type": "string"
                                        },
                                        "exchangeRate": {
                                          "type": "string"
                                        },
                                        "apy": {
                                          "type": "string"
                                        },
                                        "supplyAPY": {
                                          "type": "string"
                                        },
                                        "healthFactor": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "partial": {
                          "type": "boolean"
                        },
                        "failedProtocols": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x28c6c06298d514db089934071355e5743bf21d60",
                  "data": {
                    "totalValueUSD": 772.15,
                    "totalDepositedUSD": 772.15,
                    "totalBorrowedUSD": 0,
                    "totalRewardsUSD": 0,
                    "protocolCount": 2,
                    "protocols": [
                      {
                        "protocol": {
                          "id": "lido-steth",
                          "name": "Lido",
                          "url": "https://lido.fi",
                          "logo": "https://i.imgur.com/oQeRf5a.png",
                          "category": "liquid-staking"
                        },
                        "totalValueUSD": "772.15",
                        "positions": [
                          {
                            "id": "lido-steth-stake-steth-0x28c6c062",
                            "type": "stake",
                            "name": "Lido Staked ETH",
                            "valueUSD": 772.1459641257155,
                            "tokens": [
                              {
                                "address": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
                                "symbol": "stETH",
                                "name": "Lido Staked ETH",
                                "decimals": 18,
                                "amountRaw": "345118854967275648",
                                "amountFormatted": 0.3451188549672756,
                                "priceUSD": 2237.3334664631143,
                                "valueUSD": 772.1459641257155
                              }
                            ],
                            "metadata": {
                              "type": "liquid-staking",
                              "lstMint": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
                              "lstSymbol": "stETH",
                              "exchangeRate": "1.248668",
                              "apy": "0.0226"
                            }
                          }
                        ]
                      },
                      {
                        "protocol": {
                          "id": "aave",
                          "name": "Aave V3",
                          "url": "https://app.aave.com",
                          "logo": "https://i.imgur.com/fhGCyUI.png",
                          "category": "lending"
                        },
                        "totalValueUSD": "0.00",
                        "positions": [
                          {
                            "id": "aave-deposit-usdt",
                            "type": "deposit",
                            "name": "USDT Supply",
                            "valueUSD": 9.9880506e-7,
                            "tokens": [
                              {
                                "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
                                "symbol": "USDT",
                                "name": "Tether USD",
                                "decimals": 6,
                                "amountRaw": "0.000001",
                                "amountFormatted": 0.000001,
                                "priceUSD": 0.99880506,
                                "valueUSD": 9.9880506e-7
                              }
                            ],
                            "metadata": {
                              "type": "lending",
                              "supplyAPY": "0.03874859730506707138",
                              "healthFactor": "-1"
                            }
                          }
                        ]
                      }
                    ],
                    "partial": false,
                    "failedProtocols": []
                  },
                  "source": {
                    "provider": "market-data",
                    "endpoint": "wallet/defi-positions(v2)"
                  },
                  "freshness": {
                    "observedAt": 1794138603866,
                    "dataAt": 1794138603823,
                    "ageMs": 43,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/wallet/{wallet}/history": {
      "get": {
        "summary": "Wallet balance history (any chain)",
        "description": "Total USD value of this wallet on this chain over time, as a time series suitable for charting a portfolio curve.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_wallet_wallet_history",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "1h, 1d, 7d, 30d, 90d or 365d."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Window start."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Window end."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index). STALE EXAMPLE: captured 2026-09-25, 43 days before this page was built, and not refreshed since because the endpoint has not answered a capture run. It shows the response shape, not today's behaviour; its freshness.stale describes the data at capture time, not the age of the example.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "balanceUsd": {
                          "type": "number"
                        },
                        "wallets": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "series": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "t": {
                                "type": "number"
                              },
                              "v": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "period": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "wallet": "0x3afdc9bca9213a35503b077a6072f3d0d5ab0840",
                  "data": {
                    "balanceUsd": 366478012.8029707,
                    "wallets": [
                      "0x3afdc9bca9213a35503b077a6072f3d0d5ab0840"
                    ],
                    "series": [
                      {
                        "t": 1790290227515,
                        "v": 365605854.5454442
                      },
                      {
                        "t": 1790290619000,
                        "v": 365633263.5802153
                      }
                    ],
                    "period": "7d"
                  },
                  "source": {
                    "provider": "market-data",
                    "endpoint": "wallet/history"
                  },
                  "freshness": {
                    "observedAt": 1790376634046,
                    "dataAt": 1790376627515,
                    "ageMs": 6531,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/quote": {
      "get": {
        "summary": "Swap quote — non-custodial (any chain)",
        "description": "An UNSIGNED swap quote from an aggregator (the routing layer) or, on registry chains, the chain's own Uniswap-family quoter. Returns amounts, price impact, gas estimate, the route and — where the aggregator provides one — an unsigned transactionRequest.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_quote",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Input token address, or `native` for the chain's native asset."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Output token address, or `native`."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Input amount in the SMALLEST units of the input token; digits only, 1-78 of them (uint256 max is 78 decimal digits). Either this or amountHuman."
          },
          {
            "name": "amountHuman",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Input amount as a decimal (e.g. 0.01); converted exactly using the token's decimals. At most 78 integer and 36 fractional digits."
          },
          {
            "name": "slippageBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1-5000, default 100 (1%)."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Route preference: RECOMMENDED, FASTEST, CHEAPEST or SAFEST (case-insensitive). Anything else is a 400."
          },
          {
            "name": "fromAddress",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The sender. Without it a placeholder is used and transactionRequest is omitted."
          },
          {
            "name": "toAddress",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Recipient, when it differs from the sender. Validated against the DESTINATION chain's address format (toChain when given, otherwise this chain); a mismatch is a 400."
          },
          {
            "name": "toChain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Destination chain for a cross-chain quote; any identifier GET /api/v2/chains resolves. A destination whose measured `quote` capability is false answers 501 rather than silently becoming a same-chain quote."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "request": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "slippageBps": {
                          "type": "number"
                        },
                        "fromAddress": {},
                        "amountHuman": {
                          "type": "string"
                        }
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "custody": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        },
                        "quoteId": {
                          "type": "string"
                        },
                        "fromChainId": {
                          "type": "number"
                        },
                        "toChainId": {
                          "type": "number"
                        },
                        "fromToken": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "decimals": {
                              "type": "number"
                            },
                            "name": {
                              "type": "string"
                            },
                            "chainId": {
                              "type": "number"
                            },
                            "priceUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "toToken": {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "decimals": {
                              "type": "number"
                            },
                            "name": {
                              "type": "string"
                            },
                            "chainId": {
                              "type": "number"
                            },
                            "priceUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "fromAmount": {
                          "type": "string"
                        },
                        "toAmount": {
                          "type": "string"
                        },
                        "toAmountMin": {
                          "type": "string"
                        },
                        "fromAmountUsd": {
                          "type": "number"
                        },
                        "toAmountUsd": {
                          "type": "number"
                        },
                        "priceImpactPct": {
                          "type": "number"
                        },
                        "priceImpactBasis": {
                          "type": "string"
                        },
                        "gasCostUsd": {
                          "type": "number"
                        },
                        "feeCostUsd": {
                          "type": "number"
                        },
                        "fees": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "token": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "string"
                              },
                              "amountUsd": {
                                "type": "number"
                              },
                              "percentage": {
                                "type": "number"
                              },
                              "included": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "slippageBps": {
                          "type": "number"
                        },
                        "slippage": {
                          "type": "number"
                        },
                        "route": {
                          "type": "object",
                          "properties": {
                            "tool": {
                              "type": "string"
                            },
                            "toolName": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "steps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "tool": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "fromChainId": {
                                    "type": "number"
                                  },
                                  "toChainId": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "estimatedDurationSec": {
                          "type": "number"
                        },
                        "approval": {
                          "type": "object",
                          "properties": {
                            "required": {
                              "type": "boolean"
                            },
                            "spender": {
                              "type": "string"
                            },
                            "note": {
                              "type": "string"
                            }
                          }
                        },
                        "fromAddress": {},
                        "toAddress": {},
                        "fromAddressPlaceholder": {
                          "type": "boolean"
                        },
                        "transactionRequest": {},
                        "transactionRequestNote": {
                          "type": "string"
                        },
                        "integrator": {
                          "type": "string"
                        },
                        "quotedAt": {
                          "type": "number"
                        },
                        "expiresAt": {
                          "type": "number"
                        },
                        "expiresAtBasis": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "request": {
                    "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                    "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                    "amount": "1",
                    "slippageBps": 100,
                    "fromAddress": null,
                    "amountHuman": "1"
                  },
                  "data": {
                    "custody": "none",
                    "note": "unsigned quote; sign and submit with your own wallet",
                    "quoteId": "751e9da4-c9a2-45c6-a43d-87ab0380261f:0",
                    "fromChainId": 1,
                    "toChainId": 1,
                    "fromToken": {
                      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                      "symbol": "WETH",
                      "decimals": 18,
                      "name": "WETH",
                      "chainId": 1,
                      "priceUsd": 2237.74
                    },
                    "toToken": {
                      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                      "symbol": "USDC",
                      "decimals": 6,
                      "name": "USD Coin",
                      "chainId": 1,
                      "priceUsd": 0.9999493782
                    },
                    "fromAmount": "1000000000000000000",
                    "toAmount": "2231421762",
                    "toAmountMin": "2209107544",
                    "fromAmountUsd": 2237.74,
                    "toAmountUsd": 2231.3088,
                    "priceImpactPct": 0.2874,
                    "priceImpactBasis": "the routing layer fromAmountUSD vs toAmountUSD; includes protocol fees (the routing layer 0.25 %), excludes gas; negative means the routing layer's USD marks lag the execution price (seen -0.53 % on ETH→USDC 2026-09-02)",
                    "gasCostUsd": 0.059,
                    "feeCostUsd": 5.5944,
                    "fees": [
                      {
                        "name": "the routing layer Fixed Fee",
                        "token": "WETH",
                        "amount": "2500000000000000",
                        "amountUsd": 5.5944,
                        "percentage": 0.0025,
                        "included": true
                      }
                    ],
                    "slippageBps": 100,
                    "slippage": 0.01,
                    "route": {
                      "tool": "okx",
                      "toolName": "OKX Dex Aggregator",
                      "type": "the routing layer",
                      "steps": [
                        {
                          "tool": "feeCollection",
                          "type": "protocol",
                          "fromChainId": 1,
                          "toChainId": 1
                        },
                        {
                          "tool": "okx",
                          "type": "swap",
                          "fromChainId": 1,
                          "toChainId": 1
                        }
                      ]
                    },
                    "estimatedDurationSec": 0,
                    "approval": {
                      "required": true,
                      "spender": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                      "note": "allowance is not checked here; approve the spender before sending if it is insufficient"
                    },
                    "fromAddress": null,
                    "toAddress": null,
                    "fromAddressPlaceholder": true,
                    "transactionRequest": null,
                    "transactionRequestNote": "omitted: no fromAddress was supplied, so calldata was built for a placeholder sender and is not executable — pass fromAddress to receive it",
                    "integrator": "stryke",
                    "quotedAt": 1794138604413,
                    "expiresAt": 1794138634413,
                    "expiresAtBasis": "stryke-assigned: the routing layer stamps no expiry; re-quote after 30 s"
                  },
                  "source": {
                    "provider": "routing",
                    "endpoint": "quote"
                  },
                  "freshness": {
                    "observedAt": 1794138604413,
                    "dataAt": 1794138604413,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": [
                    "placeholder_from_address:transaction_request_omitted"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/gas": {
      "get": {
        "summary": "Gas price and L1 data fee (EVM chains)",
        "description": "gasPrice, base fee, priority fee and — on rollups that charge one — the L1 data fee, read from the chain's own JSON-RPC and the rollup's fee oracle.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_gas",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "gas",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Gas units to cost out; the response multiplies the price by this. 1-30000000."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "chain": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "gasPriceWei": {
                          "type": "string"
                        },
                        "baseFeePerGasWei": {
                          "type": "string"
                        },
                        "maxPriorityFeePerGasWei": {
                          "type": "string"
                        },
                        "blockNumber": {
                          "type": "number"
                        },
                        "burnsBaseFee": {
                          "type": "boolean"
                        },
                        "l1FeeModel": {
                          "type": "string"
                        },
                        "l1": {},
                        "source": {
                          "type": "string"
                        },
                        "degraded": {
                          "type": "array",
                          "items": {}
                        },
                        "nativeSymbol": {
                          "type": "string"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "data": {
                    "chain": "eth",
                    "chainId": 1,
                    "gasPriceWei": "35605743",
                    "baseFeePerGasWei": "35604690",
                    "maxPriorityFeePerGasWei": "1053",
                    "blockNumber": 26369962,
                    "burnsBaseFee": true,
                    "l1FeeModel": "none",
                    "l1": null,
                    "source": "rpc",
                    "degraded": [],
                    "nativeSymbol": "ETH"
                  },
                  "source": {
                    "provider": "evmrpc",
                    "endpoint": "eth_gasPrice"
                  },
                  "freshness": {
                    "observedAt": 1794138604476,
                    "dataAt": 1794138604476,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/tx/{hash}": {
      "get": {
        "summary": "Transaction receipt (EVM chains)",
        "description": "Receipt, status, gas used and the L1 data fee where the chain charges one.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_tx_hash",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          },
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed 32-byte transaction hash."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every 200 carries the same envelope: chain{key,chainId,caip2,displayName,tier}, the subject (address/wallet/query), data, source{provider,endpoint}, freshness{observedAt,dataAt,ageMs,stale} and degraded[]. `freshness.stale` is true when the provider's own data timestamp is older than this endpoint's budget — that is how a chain whose indexer has fallen behind is told apart from a live one. `degraded[]` names anything that was not ideal (e.g. provider_fallback:the market-data layer→the DEX index).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "number"
                        }
                      }
                    },
                    "hash": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "chain": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "nativeSymbol": {
                          "type": "string"
                        },
                        "explorer": {
                          "type": "string"
                        },
                        "found": {
                          "type": "boolean"
                        },
                        "hash": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "valueWei": {
                          "type": "string"
                        },
                        "nonce": {
                          "type": "number"
                        },
                        "blockNumber": {
                          "type": "number"
                        },
                        "headBlock": {
                          "type": "number"
                        },
                        "confirmations": {
                          "type": "number"
                        },
                        "confirmationsRequired": {
                          "type": "number"
                        },
                        "finalized": {
                          "type": "boolean"
                        },
                        "gasUsed": {
                          "type": "string"
                        },
                        "effectiveGasPriceWei": {
                          "type": "string"
                        },
                        "l2FeeWei": {
                          "type": "string"
                        },
                        "l1FeeWei": {},
                        "gasUsedForL1": {},
                        "totalFeeWei": {
                          "type": "string"
                        },
                        "totalFeeNative": {
                          "type": "string"
                        },
                        "logCount": {
                          "type": "number"
                        }
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "observedAt": {
                          "type": "number"
                        },
                        "dataAt": {
                          "type": "number"
                        },
                        "ageMs": {
                          "type": "number"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    },
                    "degraded": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "tier": 4
                  },
                  "hash": "0xb29d919e5b96d1d98e1b2e313a7cfe7d2690936247124d49187160130e677ae5",
                  "data": {
                    "chain": "eth",
                    "chainId": 1,
                    "nativeSymbol": "ETH",
                    "explorer": "https://etherscan.io/tx/0xb29d919e5b96d1d98e1b2e313a7cfe7d2690936247124d49187160130e677ae5",
                    "found": true,
                    "hash": "0xb29d919e5b96d1d98e1b2e313a7cfe7d2690936247124d49187160130e677ae5",
                    "status": "success",
                    "from": "0x18e755b5d51ef44068bee337ee0bedce71d7b7d2",
                    "to": "0x881d40237659c251811cec9c364ef91dc08d300c",
                    "valueWei": "0",
                    "nonce": 14,
                    "blockNumber": 25908507,
                    "headBlock": 26369962,
                    "confirmations": 461456,
                    "confirmationsRequired": 1,
                    "finalized": true,
                    "gasUsed": "188153",
                    "effectiveGasPriceWei": "2147553743",
                    "l2FeeWei": "404068679406679",
                    "l1FeeWei": null,
                    "gasUsedForL1": null,
                    "totalFeeWei": "404068679406679",
                    "totalFeeNative": "0.000404068679406679",
                    "logCount": 7
                  },
                  "source": {
                    "provider": "evmrpc",
                    "endpoint": "eth_getTransactionReceipt"
                  },
                  "freshness": {
                    "observedAt": 1794138604616,
                    "dataAt": 1794138604616,
                    "ageMs": 0,
                    "stale": false
                  },
                  "degraded": []
                }
              }
            }
          },
          "400": {
            "description": "the address does not match the chain's address format, or a query parameter is out of range — the body names it"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain, or the token/wallet does not exist on this chain"
          },
          "429": {
            "description": "Rate limited"
          },
          "501": {
            "description": "this chain cannot answer this endpoint — body carries `capability`, the measured `tier`, the prober `evidence` and a runbook link to GET /api/v2/chains/{chain}"
          },
          "502": {
            "description": "every upstream provider failed right now (retryable:true"
          }
        }
      }
    },
    "/api/v2/chain/{chain}/capabilities": {
      "get": {
        "summary": "What this chain can do",
        "description": "The catalog row for one chain: measured tier, per-capability booleans, the provider names covering it, address format, explorer templates and the prober's evidence.",
        "tags": [
          "Chain-generic market data"
        ],
        "operationId": "chain_get_chain_capabilities",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, a CAIP-2 id, or the id a provider uses (the market-data layer evm:1, the pool index eth, the DEX index ethereum). GET /api/v2/chains lists them all."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "NOT the provider envelope — this verb answers from the in-process catalog, so there is no `data`, `source`, `freshness` or `degraded` block. The body is `{success, chain, measuredAt, tiers}`: `chain` is the full catalog row (key, kind, chainId, caip2, displayName, native asset, addressFormat, explorer templates, aliases, providers, tier, tierName, capabilities and the prober evidence), `measuredAt` is when that evidence was taken, and `tiers` publishes the ladder verbatim. For the same row without a key, use GET /api/v2/chains/{chain}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "nativeSymbol": {
                          "type": "string"
                        },
                        "nativeDecimals": {
                          "type": "number"
                        },
                        "addressFormat": {
                          "type": "string"
                        },
                        "explorer": {
                          "type": "object",
                          "properties": {
                            "tx": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            },
                            "token": {
                              "type": "string"
                            }
                          }
                        },
                        "aliases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "providers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tier": {
                          "type": "number"
                        },
                        "tierName": {
                          "type": "string"
                        },
                        "capabilities": {
                          "type": "object",
                          "properties": {
                            "price": {
                              "type": "boolean"
                            },
                            "market": {
                              "type": "boolean"
                            },
                            "ohlcv": {
                              "type": "boolean"
                            },
                            "trades": {
                              "type": "boolean"
                            },
                            "pools": {
                              "type": "boolean"
                            },
                            "holders": {
                              "type": "boolean"
                            },
                            "security": {
                              "type": "boolean"
                            },
                            "metadata": {
                              "type": "boolean"
                            },
                            "portfolio": {
                              "type": "boolean"
                            },
                            "walletTrades": {
                              "type": "boolean"
                            },
                            "quote": {
                              "type": "boolean"
                            },
                            "rpc": {
                              "type": "boolean"
                            },
                            "services": {
                              "type": "boolean"
                            }
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "measuredAt": {
                              "type": "string"
                            },
                            "durationMs": {
                              "type": "number"
                            },
                            "probe": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                },
                                "pool": {},
                                "poolDex": {},
                                "source": {
                                  "type": "string"
                                },
                                "reused": {
                                  "type": "boolean"
                                }
                              }
                            },
                            "marketDataIndexing": {
                              "type": "boolean"
                            },
                            "marketDataCoverage": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "lighthouseName": {
                              "type": "string"
                            },
                            "lighthouseVolume24h": {
                              "type": "number"
                            },
                            "lighthouseTrades24h": {
                              "type": "number"
                            },
                            "lighthouseSource": {
                              "type": "string"
                            },
                            "newestTradeAgeSec": {
                              "type": "number"
                            },
                            "newestTradeExact": {
                              "type": "boolean"
                            },
                            "newestTradeSource": {
                              "type": "string"
                            },
                            "newestTradeAt": {
                              "type": "string"
                            },
                            "providerAgeSec": {
                              "type": "object",
                              "properties": {
                                "marketData": {
                                  "type": "number"
                                },
                                "poolIndex": {
                                  "type": "number"
                                },
                                "pairIndex": {
                                  "type": "number"
                                }
                              }
                            },
                            "poolIndexNetwork": {
                              "type": "boolean"
                            },
                            "poolIndexTrendingPoolAgeSec": {
                              "type": "number"
                            },
                            "poolIndexTrendingPoolAgeExact": {
                              "type": "boolean"
                            },
                            "pairIndexPairs": {
                              "type": "number"
                            },
                            "pairIndexPriceUsd": {
                              "type": "boolean"
                            },
                            "securitySupported": {
                              "type": "boolean"
                            },
                            "securityListed": {
                              "type": "boolean"
                            },
                            "securityProbe": {
                              "type": "string"
                            },
                            "securityStatus": {
                              "type": "string"
                            },
                            "routingSupported": {
                              "type": "boolean"
                            },
                            "tradeServiceConfigured": {
                              "type": "boolean"
                            },
                            "tradeServiceUp": {},
                            "servicesEvaluated": {
                              "type": "boolean"
                            },
                            "servicesLive": {
                              "type": "array",
                              "items": {}
                            },
                            "providersAnswered": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "signals": {
                              "type": "object",
                              "properties": {
                                "marketDataTrades": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "status": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataMarket": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "subjectSide": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataOhlcv": {
                                  "type": "object",
                                  "properties": {
                                    "candles": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPools": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataHolders": {
                                  "type": "object",
                                  "properties": {
                                    "total": {
                                      "type": "number"
                                    },
                                    "rows": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataSecurity": {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "string"
                                    },
                                    "http": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPortfolio": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "assets": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataWalletTrades": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "count": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "poolIndex": {
                                  "type": "object",
                                  "properties": {
                                    "present": {
                                      "type": "boolean"
                                    },
                                    "pool": {
                                      "type": "boolean"
                                    },
                                    "pools": {
                                      "type": "number"
                                    },
                                    "topPool": {
                                      "type": "string"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "trades": {}
                                  }
                                },
                                "pairIndex": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "pairs": {
                                      "type": "number"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "liquidityUsd": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "security": {
                                  "type": "object",
                                  "properties": {
                                    "result": {
                                      "type": "string"
                                    },
                                    "code": {
                                      "type": "number"
                                    }
                                  }
                                }
                              }
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            },
                            "ok": {
                              "type": "boolean"
                            },
                            "held": {
                              "type": "object",
                              "properties": {
                                "lost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "measuredTier": {
                                  "type": "number"
                                },
                                "publishedTier": {
                                  "type": "number"
                                },
                                "previousMeasuredAt": {
                                  "type": "string"
                                },
                                "note": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "execution": {
                          "type": "object",
                          "properties": {
                            "registry": {
                              "type": "boolean"
                            },
                            "readOnly": {
                              "type": "boolean"
                            },
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "tradeService": {
                              "type": "boolean"
                            }
                          }
                        },
                        "measured": {
                          "type": "boolean"
                        }
                      }
                    },
                    "measuredAt": {
                      "type": "number"
                    },
                    "tiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tier": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "predicate": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "kind": "evm",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "nativeSymbol": "ETH",
                    "nativeDecimals": 18,
                    "addressFormat": "evm",
                    "explorer": {
                      "tx": "https://etherscan.io/tx/{tx}",
                      "address": "https://etherscan.io/address/{addr}",
                      "token": "https://etherscan.io/token/{addr}"
                    },
                    "aliases": [
                      "ethereum",
                      "mainnet"
                    ],
                    "providers": [
                      "market-data",
                      "pair-index"
                    ],
                    "tier": 4,
                    "tierName": "tradeable",
                    "capabilities": {
                      "price": true,
                      "market": true,
                      "ohlcv": true,
                      "trades": true,
                      "pools": true,
                      "holders": true,
                      "security": true,
                      "metadata": true,
                      "portfolio": true,
                      "walletTrades": true,
                      "quote": true,
                      "rpc": true,
                      "services": false
                    },
                    "evidence": {
                      "measuredAt": "2026-11-08T11:17:00.070Z",
                      "durationMs": 45044,
                      "probe": {
                        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                        "symbol": "WETH",
                        "pool": null,
                        "poolDex": null,
                        "source": "registry",
                        "reused": true
                      },
                      "marketDataIndexing": true,
                      "marketDataCoverage": [
                        "metadata",
                        "market"
                      ],
                      "lighthouseName": "Ethereum",
                      "lighthouseVolume24h": 539691298.1929816,
                      "lighthouseTrades24h": 240675,
                      "lighthouseSource": "this-run",
                      "newestTradeAgeSec": 0,
                      "newestTradeExact": true,
                      "newestTradeSource": "market-data",
                      "newestTradeAt": "2026-11-08T11:24:35.000Z",
                      "providerAgeSec": {
                        "marketData": 0,
                        "poolIndex": 300,
                        "pairIndex": 300
                      },
                      "poolIndexNetwork": true,
                      "poolIndexTrendingPoolAgeSec": 300,
                      "poolIndexTrendingPoolAgeExact": false,
                      "pairIndexPairs": 30,
                      "pairIndexPriceUsd": true,
                      "securitySupported": true,
                      "securityListed": true,
                      "securityProbe": "nonempty",
                      "securityStatus": "pending",
                      "routingSupported": true,
                      "tradeServiceConfigured": false,
                      "tradeServiceUp": null,
                      "servicesEvaluated": false,
                      "servicesLive": [],
                      "providersAnswered": [
                        "pair-index",
                        "pool-index"
                      ],
                      "signals": {
                        "marketDataTrades": {
                          "count": 5,
                          "newestAt": "2026-11-08T11:24:35.000Z",
                          "priceUsd": true,
                          "status": 200,
                          "ms": 376
                        },
                        "marketDataMarket": {
                          "ok": true,
                          "subjectSide": "base",
                          "priceUsd": true,
                          "newestAt": "2026-11-08T11:24:23.000Z",
                          "status": 200
                        },
                        "marketDataOhlcv": {
                          "candles": 2,
                          "newestAt": "2026-11-08T00:00:00.000Z",
                          "status": 200
                        },
                        "marketDataPools": {
                          "count": 5,
                          "status": 200
                        },
                        "marketDataHolders": {
                          "total": 3330186,
                          "rows": 1,
                          "status": 200
                        },
                        "marketDataSecurity": {
                          "status": "pending",
                          "http": 200,
                          "ms": 5992
                        },
                        "marketDataPortfolio": {
                          "attempted": true,
                          "ok": true,
                          "assets": 11
                        },
                        "marketDataWalletTrades": {
                          "attempted": true,
                          "count": 0
                        },
                        "poolIndex": {
                          "present": true,
                          "pool": true,
                          "pools": 20,
                          "topPool": "WASTED / ETH",
                          "boundSec": 300,
                          "priceUsd": true,
                          "trades": null
                        },
                        "pairIndex": {
                          "ok": true,
                          "pairs": 30,
                          "boundSec": 300,
                          "priceUsd": true,
                          "liquidityUsd": 83420392
                        },
                        "security": {
                          "result": "nonempty",
                          "code": 1
                        }
                      },
                      "errors": [],
                      "ok": true,
                      "held": {
                        "lost": [
                          "walletTrades"
                        ],
                        "measuredTier": 4,
                        "publishedTier": 4,
                        "previousMeasuredAt": "2026-11-08T05:17:00.083Z",
                        "note": "this run missed these; a second consecutive miss demotes"
                      }
                    },
                    "execution": {
                      "registry": true,
                      "readOnly": false,
                      "products": [
                        "bump_bot",
                        "holders_bot"
                      ],
                      "tradeService": false
                    },
                    "measured": true
                  },
                  "measuredAt": 1794136620070,
                  "tiers": [
                    {
                      "tier": 0,
                      "name": "recognised",
                      "predicate": "the chain is in the catalog seed: identifiers, native asset and explorer are known"
                    },
                    {
                      "tier": 1,
                      "name": "priced",
                      "predicate": "a fresh USD price for a known token on this chain — the newest trade observed is under 24 h old"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/chains": {
      "get": {
        "summary": "List chains (public catalog)",
        "description": "Every chain in the catalog with its measured tier (0=recognised, 1=priced, 2=market, 3=forensics, 4=tradeable, 5=services), per-capability booleans, the provider NAMES that cover it, address format, explorer templates and aliases. Filters are ANDed. No API key required.",
        "tags": [
          "Chains (catalog)"
        ],
        "operationId": "get-api-v2-chains",
        "parameters": [
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "EXACTLY this tier, 0-5 — not a minimum. The ladder is a class, not a rank: tier 4 (quotable) does not imply tier 2 (live tape), because a chain can be quotable through an aggregator without our having a live tape for it. To ask \"which chains can do X\", filter on capability instead."
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact chain kind (evm, svm, move, ton, tron,...). 400 lists the kinds currently present when the value is unknown."
          },
          {
            "name": "capability",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "One of price, market, ohlcv, trades, pools, holders, security, metadata, portfolio, walletTrades, quote, rpc, services. Only rows where that capability is true."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on key, displayName and aliases. At most 64 characters."
          },
          {
            "name": "measured",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "1 = only rows the prober has measured; 0 = only rows it has not. Absent = all."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "count = rows after filtering; total = rows in the catalog; byTier is a histogram of the FILTERED rows; measuredAt is the generated evidence timestamp (ms) or null before the prober has run; tiers publishes the ladder verbatim from the catalog; chains[] are the same public chain rows /chains/{chain} returns, sorted by key. capabilities.* are what routes gate on; tier is informational. measured:false on a row means the capabilities are declared from the seed and nobody has measured them yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "total": {
                      "type": "number"
                    },
                    "byTier": {
                      "type": "object",
                      "properties": {
                        "0": {
                          "type": "number"
                        },
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        },
                        "3": {
                          "type": "number"
                        },
                        "4": {
                          "type": "number"
                        },
                        "5": {
                          "type": "number"
                        }
                      }
                    },
                    "measuredAt": {
                      "type": "number"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "tier": {},
                        "kind": {},
                        "capability": {},
                        "measured": {},
                        "q": {}
                      }
                    },
                    "tiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tier": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "predicate": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "chains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "caip2": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "nativeSymbol": {
                            "type": "string"
                          },
                          "nativeDecimals": {
                            "type": "number"
                          },
                          "addressFormat": {
                            "type": "string"
                          },
                          "explorer": {
                            "type": "object",
                            "properties": {
                              "tx": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "token": {
                                "type": "string"
                              }
                            }
                          },
                          "aliases": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "providers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "tier": {
                            "type": "number"
                          },
                          "tierName": {
                            "type": "string"
                          },
                          "capabilities": {
                            "type": "object",
                            "properties": {
                              "price": {
                                "type": "boolean"
                              },
                              "market": {
                                "type": "boolean"
                              },
                              "ohlcv": {
                                "type": "boolean"
                              },
                              "trades": {
                                "type": "boolean"
                              },
                              "pools": {
                                "type": "boolean"
                              },
                              "holders": {
                                "type": "boolean"
                              },
                              "security": {
                                "type": "boolean"
                              },
                              "metadata": {
                                "type": "boolean"
                              },
                              "portfolio": {
                                "type": "boolean"
                              },
                              "walletTrades": {
                                "type": "boolean"
                              },
                              "quote": {
                                "type": "boolean"
                              },
                              "rpc": {
                                "type": "boolean"
                              },
                              "services": {
                                "type": "boolean"
                              }
                            }
                          },
                          "evidence": {
                            "type": "object",
                            "properties": {
                              "measuredAt": {
                                "type": "string"
                              },
                              "durationMs": {
                                "type": "number"
                              },
                              "probe": {
                                "type": "object",
                                "properties": {
                                  "address": {
                                    "type": "string"
                                  },
                                  "symbol": {
                                    "type": "string"
                                  },
                                  "pool": {
                                    "type": "string"
                                  },
                                  "poolDex": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string"
                                  },
                                  "reused": {
                                    "type": "boolean"
                                  }
                                }
                              },
                              "marketDataIndexing": {},
                              "marketDataCoverage": {},
                              "lighthouseName": {},
                              "lighthouseVolume24h": {},
                              "lighthouseTrades24h": {},
                              "lighthouseSource": {},
                              "newestTradeAgeSec": {
                                "type": "number"
                              },
                              "newestTradeExact": {
                                "type": "boolean"
                              },
                              "newestTradeSource": {
                                "type": "string"
                              },
                              "newestTradeAt": {
                                "type": "string"
                              },
                              "providerAgeSec": {
                                "type": "object",
                                "properties": {
                                  "marketData": {},
                                  "poolIndex": {
                                    "type": "number"
                                  },
                                  "pairIndex": {}
                                }
                              },
                              "poolIndexNetwork": {
                                "type": "boolean"
                              },
                              "poolIndexTrendingPoolAgeSec": {
                                "type": "number"
                              },
                              "poolIndexTrendingPoolAgeExact": {
                                "type": "boolean"
                              },
                              "pairIndexPairs": {},
                              "pairIndexPriceUsd": {},
                              "securitySupported": {
                                "type": "boolean"
                              },
                              "securityListed": {
                                "type": "boolean"
                              },
                              "securityProbe": {},
                              "securityStatus": {},
                              "routingSupported": {
                                "type": "boolean"
                              },
                              "tradeServiceConfigured": {
                                "type": "boolean"
                              },
                              "tradeServiceUp": {},
                              "servicesEvaluated": {
                                "type": "boolean"
                              },
                              "servicesLive": {
                                "type": "array",
                                "items": {}
                              },
                              "providersAnswered": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "signals": {
                                "type": "object",
                                "properties": {
                                  "marketDataTrades": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataMarket": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataOhlcv": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataPools": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataHolders": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataSecurity": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataPortfolio": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "marketDataWalletTrades": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "poolIndex": {
                                    "type": "object",
                                    "properties": {
                                      "present": {
                                        "type": "boolean"
                                      },
                                      "pool": {
                                        "type": "boolean"
                                      },
                                      "pools": {
                                        "type": "number"
                                      },
                                      "topPool": {
                                        "type": "string"
                                      },
                                      "boundSec": {
                                        "type": "number"
                                      },
                                      "priceUsd": {
                                        "type": "boolean"
                                      },
                                      "trades": {
                                        "type": "number"
                                      }
                                    }
                                  },
                                  "pairIndex": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  },
                                  "security": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "boolean"
                                      }
                                    }
                                  }
                                }
                              },
                              "errors": {
                                "type": "array",
                                "items": {}
                              },
                              "ok": {
                                "type": "boolean"
                              }
                            }
                          },
                          "execution": {
                            "type": "object",
                            "properties": {
                              "registry": {
                                "type": "boolean"
                              },
                              "readOnly": {
                                "type": "boolean"
                              },
                              "products": {
                                "type": "array",
                                "items": {}
                              },
                              "tradeService": {
                                "type": "boolean"
                              }
                            }
                          },
                          "measured": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 118,
                  "total": 118,
                  "byTier": {
                    "0": 35,
                    "1": 11,
                    "2": 15,
                    "3": 2,
                    "4": 54,
                    "5": 1
                  },
                  "measuredAt": 1794136620070,
                  "filters": {
                    "tier": null,
                    "kind": null,
                    "capability": null,
                    "measured": null,
                    "q": null
                  },
                  "tiers": [
                    {
                      "tier": 0,
                      "name": "recognised",
                      "predicate": "the chain is in the catalog seed: identifiers, native asset and explorer are known"
                    },
                    {
                      "tier": 1,
                      "name": "priced",
                      "predicate": "a fresh USD price for a known token on this chain — the newest trade observed is under 24 h old"
                    },
                    {
                      "tier": 2,
                      "name": "market",
                      "predicate": "a live tape: the newest trade is under 1 h old, and the chain reports 24 h trade activity or a pool that traded within the hour"
                    },
                    {
                      "tier": 3,
                      "name": "forensics",
                      "predicate": "tier 2, and a holder-distribution and token-security analysis completed for the probe token"
                    },
                    {
                      "tier": 4,
                      "name": "tradeable",
                      "predicate": "tier 1 or better, and a non-custodial swap route can be quoted — through the aggregator layer or a first-party trade service configured for this chain"
                    },
                    {
                      "tier": 5,
                      "name": "services",
                      "predicate": "a first-party trade service is configured for this chain and a paid product on it is live"
                    }
                  ],
                  "chains": [
                    {
                      "key": "0g",
                      "kind": "evm",
                      "chainId": 16661,
                      "caip2": "eip155:16661",
                      "displayName": "0G Mainnet",
                      "nativeSymbol": "0G",
                      "nativeDecimals": 18,
                      "addressFormat": "evm",
                      "explorer": {
                        "tx": "https://chainscan.0g.ai/tx/{tx}",
                        "address": "https://chainscan.0g.ai/address/{addr}",
                        "token": "https://chainscan.0g.ai/token/{addr}"
                      },
                      "aliases": [
                        "0g mainnet",
                        "zerog",
                        "0g"
                      ],
                      "providers": [
                        "pool-index",
                        "routing"
                      ],
                      "tier": 4,
                      "tierName": "tradeable",
                      "capabilities": {
                        "price": true,
                        "market": false,
                        "ohlcv": true,
                        "trades": true,
                        "pools": true,
                        "holders": false,
                        "security": false,
                        "metadata": false,
                        "portfolio": false,
                        "walletTrades": false,
                        "quote": true,
                        "rpc": true,
                        "services": false
                      },
                      "evidence": {
                        "measuredAt": "2026-11-08T11:17:00.070Z",
                        "durationMs": 60229,
                        "probe": {
                          "address": "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c",
                          "symbol": "W0G",
                          "pool": "0x23336572435ec92d25ef0dd2d468b2a1abf7bb4f",
                          "poolDex": "zia",
                          "source": "pool-index-trending",
                          "reused": true
                        },
                        "marketDataIndexing": null,
                        "marketDataCoverage": null,
                        "lighthouseName": null,
                        "lighthouseVolume24h": null,
                        "lighthouseTrades24h": null,
                        "lighthouseSource": null,
                        "newestTradeAgeSec": 109,
                        "newestTradeExact": true,
                        "newestTradeSource": "pool-index",
                        "newestTradeAt": "2026-11-08T11:15:11.000Z",
                        "providerAgeSec": {
                          "marketData": null,
                          "poolIndex": 109,
                          "pairIndex": null
                        },
                        "poolIndexNetwork": true,
                        "poolIndexTrendingPoolAgeSec": 109,
                        "poolIndexTrendingPoolAgeExact": true,
                        "pairIndexPairs": null,
                        "pairIndexPriceUsd": null,
                        "securitySupported": false,
                        "securityListed": false,
                        "securityProbe": null,
                        "securityStatus": null,
                        "routingSupported": true,
                        "tradeServiceConfigured": false,
                        "tradeServiceUp": null,
                        "servicesEvaluated": false,
                        "servicesLive": [],
                        "providersAnswered": [
                          "pool-index",
                          "routing",
                          "rpc"
                        ],
                        "signals": {
                          "marketDataTrades": {
                            "attempted": false
                          },
                          "marketDataMarket": {
                            "attempted": false
                          },
                          "marketDataOhlcv": {
                            "attempted": false
                          },
                          "marketDataPools": {
                            "attempted": false
                          },
                          "marketDataHolders": {
                            "attempted": false
                          },
                          "marketDataSecurity": {
                            "attempted": false
                          },
                          "marketDataPortfolio": {
                            "attempted": false
                          },
                          "marketDataWalletTrades": {
                            "attempted": false
                          },
                          "poolIndex": {
                            "present": true,
                            "pool": true,
                            "pools": 20,
                            "topPool": "USDC.e / W0G 0.3%",
                            "boundSec": 300,
                            "priceUsd": true,
                            "trades": 87
                          },
                          "pairIndex": {
                            "attempted": false
                          },
                          "security": {
                            "attempted": false
                          }
                        },
                        "errors": [],
                        "ok": true
                      },
                      "execution": {
                        "registry": false,
                        "readOnly": false,
                        "products": [],
                        "tradeService": false
                      },
                      "measured": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid query parameter (success:false, error names the parameter and the accepted values"
          },
          "404": {
            "description": "not found (any path not listed here; success:false, hint"
          },
          "429": {
            "description": "per-IP rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/chains/summary": {
      "get": {
        "summary": "Catalog summary",
        "description": "Counts only: rows by tier, by kind and by capability, how many rows the prober has measured, how many are in the execution registry, plus the tier ladder and the evidence timestamp.",
        "tags": [
          "Chains (catalog)"
        ],
        "operationId": "get-api-v2-chains-summary",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "generated:false and measuredAt:null together mean the prober has not run yet; every row is then tier 0 with seed-declared capabilities. capabilities.<name> counts rows where that capability is true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    },
                    "byTier": {
                      "type": "object",
                      "properties": {
                        "0": {
                          "type": "number"
                        },
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        },
                        "3": {
                          "type": "number"
                        },
                        "4": {
                          "type": "number"
                        },
                        "5": {
                          "type": "number"
                        }
                      }
                    },
                    "measuredAt": {
                      "type": "number"
                    },
                    "generated": {
                      "type": "boolean"
                    },
                    "measured": {
                      "type": "number"
                    },
                    "registry": {
                      "type": "number"
                    },
                    "tiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tier": {
                            "type": "number"
                          },
                          "name": {
                            "type": "string"
                          },
                          "predicate": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "type": "number"
                        },
                        "market": {
                          "type": "number"
                        },
                        "ohlcv": {
                          "type": "number"
                        },
                        "trades": {
                          "type": "number"
                        },
                        "pools": {
                          "type": "number"
                        },
                        "holders": {
                          "type": "number"
                        },
                        "security": {
                          "type": "number"
                        },
                        "metadata": {
                          "type": "number"
                        },
                        "portfolio": {
                          "type": "number"
                        },
                        "walletTrades": {
                          "type": "number"
                        },
                        "quote": {
                          "type": "number"
                        },
                        "rpc": {
                          "type": "number"
                        },
                        "services": {
                          "type": "number"
                        }
                      }
                    },
                    "kinds": {
                      "type": "object",
                      "properties": {
                        "cosmos": {
                          "type": "number"
                        },
                        "evm": {
                          "type": "number"
                        },
                        "move": {
                          "type": "number"
                        },
                        "other": {
                          "type": "number"
                        },
                        "starknet": {
                          "type": "number"
                        },
                        "svm": {
                          "type": "number"
                        },
                        "ton": {
                          "type": "number"
                        },
                        "tron": {
                          "type": "number"
                        },
                        "utxo": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "count": 118,
                  "byTier": {
                    "0": 35,
                    "1": 11,
                    "2": 15,
                    "3": 2,
                    "4": 54,
                    "5": 1
                  },
                  "measuredAt": 1794136620070,
                  "generated": true,
                  "measured": 118,
                  "registry": 26,
                  "tiers": [
                    {
                      "tier": 0,
                      "name": "recognised",
                      "predicate": "the chain is in the catalog seed: identifiers, native asset and explorer are known"
                    },
                    {
                      "tier": 1,
                      "name": "priced",
                      "predicate": "a fresh USD price for a known token on this chain — the newest trade observed is under 24 h old"
                    },
                    {
                      "tier": 2,
                      "name": "market",
                      "predicate": "a live tape: the newest trade is under 1 h old, and the chain reports 24 h trade activity or a pool that traded within the hour"
                    },
                    {
                      "tier": 3,
                      "name": "forensics",
                      "predicate": "tier 2, and a holder-distribution and token-security analysis completed for the probe token"
                    },
                    {
                      "tier": 4,
                      "name": "tradeable",
                      "predicate": "tier 1 or better, and a non-custodial swap route can be quoted — through the aggregator layer or a first-party trade service configured for this chain"
                    },
                    {
                      "tier": 5,
                      "name": "services",
                      "predicate": "a first-party trade service is configured for this chain and a paid product on it is live"
                    }
                  ],
                  "capabilities": {
                    "price": 83,
                    "market": 47,
                    "ohlcv": 81,
                    "trades": 71,
                    "pools": 83,
                    "holders": 49,
                    "security": 38,
                    "metadata": 52,
                    "portfolio": 82,
                    "walletTrades": 78,
                    "quote": 62,
                    "rpc": 87,
                    "services": 1
                  },
                  "kinds": {
                    "cosmos": 1,
                    "evm": 106,
                    "move": 2,
                    "other": 3,
                    "starknet": 1,
                    "svm": 1,
                    "ton": 1,
                    "tron": 1,
                    "utxo": 2
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found (any path not listed here; success:false, hint"
          },
          "429": {
            "description": "per-IP rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/chains/resolve": {
      "get": {
        "summary": "Resolve a chain identifier",
        "description": "Turns any chain identifier (key, alias, display name, EIP-155 id, evm:<id>, eip155:<id>, CAIP-2, or a provider's chain id) into the one catalog row it names, or 404.",
        "tags": [
          "Chains (catalog)"
        ],
        "operationId": "get-api-v2-chains-resolve",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The identifier to resolve. Case-insensitive; at most 128 characters."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "chain is the same publicView row the list returns. On a miss: 404 { success:false, error:\"unknown chain\", hint:\"GET /api/v2/chains\", suggestions?:[keys] } — suggestions are catalog keys whose key, name or alias contains the query.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "nativeSymbol": {
                          "type": "string"
                        },
                        "nativeDecimals": {
                          "type": "number"
                        },
                        "addressFormat": {
                          "type": "string"
                        },
                        "explorer": {
                          "type": "object",
                          "properties": {
                            "tx": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            },
                            "token": {
                              "type": "string"
                            }
                          }
                        },
                        "aliases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "providers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tier": {
                          "type": "number"
                        },
                        "tierName": {
                          "type": "string"
                        },
                        "capabilities": {
                          "type": "object",
                          "properties": {
                            "price": {
                              "type": "boolean"
                            },
                            "market": {
                              "type": "boolean"
                            },
                            "ohlcv": {
                              "type": "boolean"
                            },
                            "trades": {
                              "type": "boolean"
                            },
                            "pools": {
                              "type": "boolean"
                            },
                            "holders": {
                              "type": "boolean"
                            },
                            "security": {
                              "type": "boolean"
                            },
                            "metadata": {
                              "type": "boolean"
                            },
                            "portfolio": {
                              "type": "boolean"
                            },
                            "walletTrades": {
                              "type": "boolean"
                            },
                            "quote": {
                              "type": "boolean"
                            },
                            "rpc": {
                              "type": "boolean"
                            },
                            "services": {
                              "type": "boolean"
                            }
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "measuredAt": {
                              "type": "string"
                            },
                            "durationMs": {
                              "type": "number"
                            },
                            "probe": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                },
                                "pool": {},
                                "poolDex": {},
                                "source": {
                                  "type": "string"
                                },
                                "reused": {
                                  "type": "boolean"
                                }
                              }
                            },
                            "marketDataIndexing": {
                              "type": "boolean"
                            },
                            "marketDataCoverage": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "lighthouseName": {
                              "type": "string"
                            },
                            "lighthouseVolume24h": {
                              "type": "number"
                            },
                            "lighthouseTrades24h": {
                              "type": "number"
                            },
                            "lighthouseSource": {
                              "type": "string"
                            },
                            "newestTradeAgeSec": {
                              "type": "number"
                            },
                            "newestTradeExact": {
                              "type": "boolean"
                            },
                            "newestTradeSource": {
                              "type": "string"
                            },
                            "newestTradeAt": {
                              "type": "string"
                            },
                            "providerAgeSec": {
                              "type": "object",
                              "properties": {
                                "marketData": {
                                  "type": "number"
                                },
                                "poolIndex": {
                                  "type": "number"
                                },
                                "pairIndex": {
                                  "type": "number"
                                }
                              }
                            },
                            "poolIndexNetwork": {
                              "type": "boolean"
                            },
                            "poolIndexTrendingPoolAgeSec": {
                              "type": "number"
                            },
                            "poolIndexTrendingPoolAgeExact": {
                              "type": "boolean"
                            },
                            "pairIndexPairs": {
                              "type": "number"
                            },
                            "pairIndexPriceUsd": {
                              "type": "boolean"
                            },
                            "securitySupported": {
                              "type": "boolean"
                            },
                            "securityListed": {
                              "type": "boolean"
                            },
                            "securityProbe": {
                              "type": "string"
                            },
                            "securityStatus": {
                              "type": "string"
                            },
                            "routingSupported": {
                              "type": "boolean"
                            },
                            "tradeServiceConfigured": {
                              "type": "boolean"
                            },
                            "tradeServiceUp": {},
                            "servicesEvaluated": {
                              "type": "boolean"
                            },
                            "servicesLive": {
                              "type": "array",
                              "items": {}
                            },
                            "providersAnswered": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "signals": {
                              "type": "object",
                              "properties": {
                                "marketDataTrades": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "status": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataMarket": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "subjectSide": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataOhlcv": {
                                  "type": "object",
                                  "properties": {
                                    "candles": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPools": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataHolders": {
                                  "type": "object",
                                  "properties": {
                                    "total": {
                                      "type": "number"
                                    },
                                    "rows": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataSecurity": {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "string"
                                    },
                                    "http": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPortfolio": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "assets": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataWalletTrades": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "count": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "poolIndex": {
                                  "type": "object",
                                  "properties": {
                                    "present": {
                                      "type": "boolean"
                                    },
                                    "pool": {
                                      "type": "boolean"
                                    },
                                    "pools": {
                                      "type": "number"
                                    },
                                    "topPool": {
                                      "type": "string"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "trades": {}
                                  }
                                },
                                "pairIndex": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "pairs": {
                                      "type": "number"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "liquidityUsd": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "security": {
                                  "type": "object",
                                  "properties": {
                                    "result": {
                                      "type": "string"
                                    },
                                    "code": {
                                      "type": "number"
                                    }
                                  }
                                }
                              }
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            },
                            "ok": {
                              "type": "boolean"
                            },
                            "held": {
                              "type": "object",
                              "properties": {
                                "lost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "measuredTier": {
                                  "type": "number"
                                },
                                "publishedTier": {
                                  "type": "number"
                                },
                                "previousMeasuredAt": {
                                  "type": "string"
                                },
                                "note": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "execution": {
                          "type": "object",
                          "properties": {
                            "registry": {
                              "type": "boolean"
                            },
                            "readOnly": {
                              "type": "boolean"
                            },
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "tradeService": {
                              "type": "boolean"
                            }
                          }
                        },
                        "measured": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "query": "ethereum",
                  "chain": {
                    "key": "eth",
                    "kind": "evm",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "nativeSymbol": "ETH",
                    "nativeDecimals": 18,
                    "addressFormat": "evm",
                    "explorer": {
                      "tx": "https://etherscan.io/tx/{tx}",
                      "address": "https://etherscan.io/address/{addr}",
                      "token": "https://etherscan.io/token/{addr}"
                    },
                    "aliases": [
                      "ethereum",
                      "mainnet",
                      "ether",
                      "erc20",
                      "ethereum mainnet",
                      "eth"
                    ],
                    "providers": [
                      "market-data",
                      "pair-index",
                      "pool-index",
                      "routing",
                      "security"
                    ],
                    "tier": 4,
                    "tierName": "tradeable",
                    "capabilities": {
                      "price": true,
                      "market": true,
                      "ohlcv": true,
                      "trades": true,
                      "pools": true,
                      "holders": true,
                      "security": true,
                      "metadata": true,
                      "portfolio": true,
                      "walletTrades": true,
                      "quote": true,
                      "rpc": true,
                      "services": false
                    },
                    "evidence": {
                      "measuredAt": "2026-11-08T11:17:00.070Z",
                      "durationMs": 45044,
                      "probe": {
                        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                        "symbol": "WETH",
                        "pool": null,
                        "poolDex": null,
                        "source": "registry",
                        "reused": true
                      },
                      "marketDataIndexing": true,
                      "marketDataCoverage": [
                        "metadata",
                        "market",
                        "explorer"
                      ],
                      "lighthouseName": "Ethereum",
                      "lighthouseVolume24h": 539691298.1929816,
                      "lighthouseTrades24h": 240675,
                      "lighthouseSource": "this-run",
                      "newestTradeAgeSec": 0,
                      "newestTradeExact": true,
                      "newestTradeSource": "market-data",
                      "newestTradeAt": "2026-11-08T11:24:35.000Z",
                      "providerAgeSec": {
                        "marketData": 0,
                        "poolIndex": 300,
                        "pairIndex": 300
                      },
                      "poolIndexNetwork": true,
                      "poolIndexTrendingPoolAgeSec": 300,
                      "poolIndexTrendingPoolAgeExact": false,
                      "pairIndexPairs": 30,
                      "pairIndexPriceUsd": true,
                      "securitySupported": true,
                      "securityListed": true,
                      "securityProbe": "nonempty",
                      "securityStatus": "pending",
                      "routingSupported": true,
                      "tradeServiceConfigured": false,
                      "tradeServiceUp": null,
                      "servicesEvaluated": false,
                      "servicesLive": [],
                      "providersAnswered": [
                        "pair-index",
                        "pool-index",
                        "security",
                        "routing",
                        "market-data",
                        "rpc"
                      ],
                      "signals": {
                        "marketDataTrades": {
                          "count": 5,
                          "newestAt": "2026-11-08T11:24:35.000Z",
                          "priceUsd": true,
                          "status": 200,
                          "ms": 376
                        },
                        "marketDataMarket": {
                          "ok": true,
                          "subjectSide": "base",
                          "priceUsd": true,
                          "newestAt": "2026-11-08T11:24:23.000Z",
                          "status": 200
                        },
                        "marketDataOhlcv": {
                          "candles": 2,
                          "newestAt": "2026-11-08T00:00:00.000Z",
                          "status": 200
                        },
                        "marketDataPools": {
                          "count": 5,
                          "status": 200
                        },
                        "marketDataHolders": {
                          "total": 3330186,
                          "rows": 1,
                          "status": 200
                        },
                        "marketDataSecurity": {
                          "status": "pending",
                          "http": 200,
                          "ms": 5992
                        },
                        "marketDataPortfolio": {
                          "attempted": true,
                          "ok": true,
                          "assets": 11
                        },
                        "marketDataWalletTrades": {
                          "attempted": true,
                          "count": 0
                        },
                        "poolIndex": {
                          "present": true,
                          "pool": true,
                          "pools": 20,
                          "topPool": "WASTED / ETH",
                          "boundSec": 300,
                          "priceUsd": true,
                          "trades": null
                        },
                        "pairIndex": {
                          "ok": true,
                          "pairs": 30,
                          "boundSec": 300,
                          "priceUsd": true,
                          "liquidityUsd": 83420392
                        },
                        "security": {
                          "result": "nonempty",
                          "code": 1
                        }
                      },
                      "errors": [],
                      "ok": true,
                      "held": {
                        "lost": [
                          "walletTrades"
                        ],
                        "measuredTier": 4,
                        "publishedTier": 4,
                        "previousMeasuredAt": "2026-11-08T05:17:00.083Z",
                        "note": "this run missed these; a second consecutive miss demotes"
                      }
                    },
                    "execution": {
                      "registry": true,
                      "readOnly": false,
                      "products": [
                        "bump_bot",
                        "holders_bot",
                        "makers_bot",
                        "volume_bot"
                      ],
                      "tradeService": false
                    },
                    "measured": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "q is required / q too long"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "per-IP rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/chains/{chain}": {
      "get": {
        "summary": "One chain, with the routes it supports",
        "description": "The publicView row for one chain plus the /api/v2/chain/{chain}/* routes that will work on it given its measured capabilities, and — separately — the ones that will 501, each with the reason.",
        "tags": [
          "Chains (catalog)"
        ],
        "operationId": "get-api-v2-chains-chain",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any identifier the catalog resolves, case-insensitively: the Stryke key (eth), an alias (ethereum), the display name, an EIP-155 id (1), evm:1, eip155:1, any CAIP-2 id, or the id a provider uses for the chain (the market-data layer evm:1, the pool index eth, the DEX index ethereum)."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "endpoints[] are available now (authRequired:true — they live under the keyed /api/v2/chain namespace); unavailable[] carries the missing capability and a reason. The capability per route is routing.capOf(verb), the same table the dataplane 501-gates on, so this list and the 501s cannot disagree. /gas is evm-only; /tx is evm and svm; /capabilities is always available. chain.evidence.held, when present, means this probe measured a capability as LOST and the previous verdict is being published for one more run — evidence.held.lost names them and evidence.held.measuredTier is what this run actually measured. A second consecutive miss demotes. A capability GAINED is never held; it is published on the first run that proves it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "chain": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "chainId": {
                          "type": "number"
                        },
                        "caip2": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "nativeSymbol": {
                          "type": "string"
                        },
                        "nativeDecimals": {
                          "type": "number"
                        },
                        "addressFormat": {
                          "type": "string"
                        },
                        "explorer": {
                          "type": "object",
                          "properties": {
                            "tx": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            },
                            "token": {
                              "type": "string"
                            }
                          }
                        },
                        "aliases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "providers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tier": {
                          "type": "number"
                        },
                        "tierName": {
                          "type": "string"
                        },
                        "capabilities": {
                          "type": "object",
                          "properties": {
                            "price": {
                              "type": "boolean"
                            },
                            "market": {
                              "type": "boolean"
                            },
                            "ohlcv": {
                              "type": "boolean"
                            },
                            "trades": {
                              "type": "boolean"
                            },
                            "pools": {
                              "type": "boolean"
                            },
                            "holders": {
                              "type": "boolean"
                            },
                            "security": {
                              "type": "boolean"
                            },
                            "metadata": {
                              "type": "boolean"
                            },
                            "portfolio": {
                              "type": "boolean"
                            },
                            "walletTrades": {
                              "type": "boolean"
                            },
                            "quote": {
                              "type": "boolean"
                            },
                            "rpc": {
                              "type": "boolean"
                            },
                            "services": {
                              "type": "boolean"
                            }
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "measuredAt": {
                              "type": "string"
                            },
                            "durationMs": {
                              "type": "number"
                            },
                            "probe": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                },
                                "pool": {},
                                "poolDex": {},
                                "source": {
                                  "type": "string"
                                },
                                "reused": {
                                  "type": "boolean"
                                }
                              }
                            },
                            "marketDataIndexing": {
                              "type": "boolean"
                            },
                            "marketDataCoverage": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "lighthouseName": {
                              "type": "string"
                            },
                            "lighthouseVolume24h": {
                              "type": "number"
                            },
                            "lighthouseTrades24h": {
                              "type": "number"
                            },
                            "lighthouseSource": {
                              "type": "string"
                            },
                            "newestTradeAgeSec": {
                              "type": "number"
                            },
                            "newestTradeExact": {
                              "type": "boolean"
                            },
                            "newestTradeSource": {
                              "type": "string"
                            },
                            "newestTradeAt": {
                              "type": "string"
                            },
                            "providerAgeSec": {
                              "type": "object",
                              "properties": {
                                "marketData": {
                                  "type": "number"
                                },
                                "poolIndex": {
                                  "type": "number"
                                },
                                "pairIndex": {
                                  "type": "number"
                                }
                              }
                            },
                            "poolIndexNetwork": {
                              "type": "boolean"
                            },
                            "poolIndexTrendingPoolAgeSec": {
                              "type": "number"
                            },
                            "poolIndexTrendingPoolAgeExact": {
                              "type": "boolean"
                            },
                            "pairIndexPairs": {
                              "type": "number"
                            },
                            "pairIndexPriceUsd": {
                              "type": "boolean"
                            },
                            "securitySupported": {
                              "type": "boolean"
                            },
                            "securityListed": {
                              "type": "boolean"
                            },
                            "securityProbe": {
                              "type": "string"
                            },
                            "securityStatus": {
                              "type": "string"
                            },
                            "routingSupported": {
                              "type": "boolean"
                            },
                            "tradeServiceConfigured": {
                              "type": "boolean"
                            },
                            "tradeServiceUp": {},
                            "servicesEvaluated": {
                              "type": "boolean"
                            },
                            "servicesLive": {
                              "type": "array",
                              "items": {}
                            },
                            "providersAnswered": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "signals": {
                              "type": "object",
                              "properties": {
                                "marketDataTrades": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "status": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataMarket": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "subjectSide": {
                                      "type": "string"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataOhlcv": {
                                  "type": "object",
                                  "properties": {
                                    "candles": {
                                      "type": "number"
                                    },
                                    "newestAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPools": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataHolders": {
                                  "type": "object",
                                  "properties": {
                                    "total": {
                                      "type": "number"
                                    },
                                    "rows": {
                                      "type": "number"
                                    },
                                    "status": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataSecurity": {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "string"
                                    },
                                    "http": {
                                      "type": "number"
                                    },
                                    "ms": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataPortfolio": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "assets": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "marketDataWalletTrades": {
                                  "type": "object",
                                  "properties": {
                                    "attempted": {
                                      "type": "boolean"
                                    },
                                    "count": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "poolIndex": {
                                  "type": "object",
                                  "properties": {
                                    "present": {
                                      "type": "boolean"
                                    },
                                    "pool": {
                                      "type": "boolean"
                                    },
                                    "pools": {
                                      "type": "number"
                                    },
                                    "topPool": {
                                      "type": "string"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "trades": {}
                                  }
                                },
                                "pairIndex": {
                                  "type": "object",
                                  "properties": {
                                    "ok": {
                                      "type": "boolean"
                                    },
                                    "pairs": {
                                      "type": "number"
                                    },
                                    "boundSec": {
                                      "type": "number"
                                    },
                                    "priceUsd": {
                                      "type": "boolean"
                                    },
                                    "liquidityUsd": {
                                      "type": "number"
                                    }
                                  }
                                },
                                "security": {
                                  "type": "object",
                                  "properties": {
                                    "result": {
                                      "type": "string"
                                    },
                                    "code": {
                                      "type": "number"
                                    }
                                  }
                                }
                              }
                            },
                            "errors": {
                              "type": "array",
                              "items": {}
                            },
                            "ok": {
                              "type": "boolean"
                            },
                            "held": {
                              "type": "object",
                              "properties": {
                                "lost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "measuredTier": {
                                  "type": "number"
                                },
                                "publishedTier": {
                                  "type": "number"
                                },
                                "previousMeasuredAt": {
                                  "type": "string"
                                },
                                "note": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "execution": {
                          "type": "object",
                          "properties": {
                            "registry": {
                              "type": "boolean"
                            },
                            "readOnly": {
                              "type": "boolean"
                            },
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "tradeService": {
                              "type": "boolean"
                            }
                          }
                        },
                        "measured": {
                          "type": "boolean"
                        }
                      }
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "method": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "verb": {
                            "type": "string"
                          },
                          "capability": {
                            "type": "string"
                          },
                          "authRequired": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "unavailable": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "success": true,
                  "chain": {
                    "key": "eth",
                    "kind": "evm",
                    "chainId": 1,
                    "caip2": "eip155:1",
                    "displayName": "Ethereum",
                    "nativeSymbol": "ETH",
                    "nativeDecimals": 18,
                    "addressFormat": "evm",
                    "explorer": {
                      "tx": "https://etherscan.io/tx/{tx}",
                      "address": "https://etherscan.io/address/{addr}",
                      "token": "https://etherscan.io/token/{addr}"
                    },
                    "aliases": [
                      "ethereum",
                      "mainnet",
                      "ether",
                      "erc20",
                      "ethereum mainnet",
                      "eth"
                    ],
                    "providers": [
                      "market-data",
                      "pair-index",
                      "pool-index",
                      "routing",
                      "security"
                    ],
                    "tier": 4,
                    "tierName": "tradeable",
                    "capabilities": {
                      "price": true,
                      "market": true,
                      "ohlcv": true,
                      "trades": true,
                      "pools": true,
                      "holders": true,
                      "security": true,
                      "metadata": true,
                      "portfolio": true,
                      "walletTrades": true,
                      "quote": true,
                      "rpc": true,
                      "services": false
                    },
                    "evidence": {
                      "measuredAt": "2026-11-08T11:17:00.070Z",
                      "durationMs": 45044,
                      "probe": {
                        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                        "symbol": "WETH",
                        "pool": null,
                        "poolDex": null,
                        "source": "registry",
                        "reused": true
                      },
                      "marketDataIndexing": true,
                      "marketDataCoverage": [
                        "metadata",
                        "market",
                        "explorer"
                      ],
                      "lighthouseName": "Ethereum",
                      "lighthouseVolume24h": 539691298.1929816,
                      "lighthouseTrades24h": 240675,
                      "lighthouseSource": "this-run",
                      "newestTradeAgeSec": 0,
                      "newestTradeExact": true,
                      "newestTradeSource": "market-data",
                      "newestTradeAt": "2026-11-08T11:24:35.000Z",
                      "providerAgeSec": {
                        "marketData": 0,
                        "poolIndex": 300,
                        "pairIndex": 300
                      },
                      "poolIndexNetwork": true,
                      "poolIndexTrendingPoolAgeSec": 300,
                      "poolIndexTrendingPoolAgeExact": false,
                      "pairIndexPairs": 30,
                      "pairIndexPriceUsd": true,
                      "securitySupported": true,
                      "securityListed": true,
                      "securityProbe": "nonempty",
                      "securityStatus": "pending",
                      "routingSupported": true,
                      "tradeServiceConfigured": false,
                      "tradeServiceUp": null,
                      "servicesEvaluated": false,
                      "servicesLive": [],
                      "providersAnswered": [
                        "pair-index",
                        "pool-index",
                        "security",
                        "routing",
                        "market-data",
                        "rpc"
                      ],
                      "signals": {
                        "marketDataTrades": {
                          "count": 5,
                          "newestAt": "2026-11-08T11:24:35.000Z",
                          "priceUsd": true,
                          "status": 200,
                          "ms": 376
                        },
                        "marketDataMarket": {
                          "ok": true,
                          "subjectSide": "base",
                          "priceUsd": true,
                          "newestAt": "2026-11-08T11:24:23.000Z",
                          "status": 200
                        },
                        "marketDataOhlcv": {
                          "candles": 2,
                          "newestAt": "2026-11-08T00:00:00.000Z",
                          "status": 200
                        },
                        "marketDataPools": {
                          "count": 5,
                          "status": 200
                        },
                        "marketDataHolders": {
                          "total": 3330186,
                          "rows": 1,
                          "status": 200
                        },
                        "marketDataSecurity": {
                          "status": "pending",
                          "http": 200,
                          "ms": 5992
                        },
                        "marketDataPortfolio": {
                          "attempted": true,
                          "ok": true,
                          "assets": 11
                        },
                        "marketDataWalletTrades": {
                          "attempted": true,
                          "count": 0
                        },
                        "poolIndex": {
                          "present": true,
                          "pool": true,
                          "pools": 20,
                          "topPool": "WASTED / ETH",
                          "boundSec": 300,
                          "priceUsd": true,
                          "trades": null
                        },
                        "pairIndex": {
                          "ok": true,
                          "pairs": 30,
                          "boundSec": 300,
                          "priceUsd": true,
                          "liquidityUsd": 83420392
                        },
                        "security": {
                          "result": "nonempty",
                          "code": 1
                        }
                      },
                      "errors": [],
                      "ok": true,
                      "held": {
                        "lost": [
                          "walletTrades"
                        ],
                        "measuredTier": 4,
                        "publishedTier": 4,
                        "previousMeasuredAt": "2026-11-08T05:17:00.083Z",
                        "note": "this run missed these; a second consecutive miss demotes"
                      }
                    },
                    "execution": {
                      "registry": true,
                      "readOnly": false,
                      "products": [
                        "bump_bot",
                        "holders_bot",
                        "makers_bot",
                        "volume_bot"
                      ],
                      "tradeService": false
                    },
                    "measured": true
                  },
                  "endpoints": [
                    {
                      "method": "GET",
                      "path": "/api/v2/chain/eth/token/{address}",
                      "verb": "getToken",
                      "capability": "market",
                      "authRequired": true
                    },
                    {
                      "method": "GET",
                      "path": "/api/v2/chain/eth/token/{address}/price",
                      "verb": "getPrice",
                      "capability": "price",
                      "authRequired": true
                    },
                    {
                      "method": "GET",
                      "path": "/api/v2/chain/eth/token/{address}/ohlcv",
                      "verb": "getSeries",
                      "capability": "ohlcv",
                      "authRequired": true
                    }
                  ],
                  "unavailable": []
                }
              }
            }
          },
          "404": {
            "description": "unknown chain (success:false, hint, suggestions?; not found for any deeper path"
          },
          "429": {
            "description": "per-IP rate limit exceeded"
          }
        }
      }
    },
    "/api/v2/pairs": {
      "get": {
        "summary": "Rank pairs",
        "description": "The screener. Ranked pools with price, change, volume, transactions, liquidity, FDV and age.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs",
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol, or omit for all three."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "volume24h (default), volume6h, volume1h, volume5m, liquidity, txns24h, change24h, change6h, change1h, change5m, fdv, age, lastTrade."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "'desc' (default) or 'asc'."
          },
          {
            "name": "minLiquidityUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Defaults to 1. Pass 0 to include pools whose depth was never measured — their volume is NOT trustworthy; see volumeTrusted on each row."
          },
          {
            "name": "minVolume24hUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Floor on 24h volume."
          },
          {
            "name": "minTxns24h",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Floor on 24h transaction count."
          },
          {
            "name": "maxAge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only pairs first traded within this long, e.g. '15m', '6h', '7d'. Implies an exact first-trade timestamp."
          },
          {
            "name": "minAge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only pairs older than this."
          },
          {
            "name": "dex",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact venue match, e.g. pumpswap, orca-whirlpool, uniswap-v3."
          },
          {
            "name": "activeWithin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only pairs whose LAST trade is this recent, e.g. '15m', '1h'. Sorted by 24h volume, a pool that pumped and stopped still ranks — one real example carried $164.32M across 167,749 transactions and had been dead for nine hours. Not applied by default."
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Every pair whose BASE side is this token."
          },
          {
            "name": "pools",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated pool addresses (max 200) — how a watchlist is fetched in one request."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-500, default 50."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "0-10000, default 0."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/trending": {
      "get": {
        "summary": "Trending pairs",
        "description": "Ranked by 1-hour volume, with a floor on transaction count so one large trade cannot buy the top of the list.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-trending",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/new": {
      "get": {
        "summary": "New pairs",
        "description": "Pairs whose FIRST trade the index actually witnessed. Pairs whose history merely begins at the edge of the tape's retention window are excluded rather than shown as new.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-new",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/gainers": {
      "get": {
        "summary": "Gainers",
        "description": "Ranked by 24h change, with liquidity and transaction floors so the list is not a directory of empty pools, and a recency floor so it is not a directory of pairs that stopped trading.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-gainers",
        "parameters": [
          {
            "name": "activeWithin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "How recently the pair must have traded, e.g. '15m', '2h'. Defaults to 2h on this feed; '0' removes it."
          },
          {
            "name": "minLiquidityUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Defaults to 5000 here."
          },
          {
            "name": "minTxns24h",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Defaults to 50 here."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol, or omit for all three."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Two recency rules apply. A change is never ranked for a pair that did not trade inside that window — without it this feed led with a pair at +4,959,000,000,000,000% that had zero candles in 24 hours. On top of that both mover feeds default to pairs that traded in the last 2 hours, because a “biggest loser” nobody can trade is a museum exhibit: the top of /losers was six rows at -100% whose last trades were 8 to 23 hours earlier. Pass activeWithin=24h to widen it, or activeWithin=0 to remove it; filters echoes what applied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/losers": {
      "get": {
        "summary": "Losers",
        "description": "Ranked by 24h change ascending, same floors as gainers.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-losers",
        "parameters": [
          {
            "name": "activeWithin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "How recently the pair must have traded, e.g. '15m', '2h'. Defaults to 2h on this feed; '0' removes it."
          },
          {
            "name": "minLiquidityUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Defaults to 5000 here."
          },
          {
            "name": "minTxns24h",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Defaults to 50 here."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol, or omit for all three."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-500, default 50."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Two recency rules apply. A change is never ranked for a pair that did not trade inside that window — without it this feed led with a pair at +4,959,000,000,000,000% that had zero candles in 24 hours. On top of that both mover feeds default to pairs that traded in the last 2 hours, because a “biggest loser” nobody can trade is a museum exhibit: the top of /losers was six rows at -100% whose last trades were 8 to 23 hours earlier. Pass activeWithin=24h to widen it, or activeWithin=0 to remove it; filters echoes what applied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/search": {
      "get": {
        "summary": "Search pairs",
        "description": "By token symbol (prefix), token name (contains), or exact token/pool address. Ordered by liquidity.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Symbol, name or address."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/stats": {
      "get": {
        "summary": "Index totals",
        "description": "Per-chain pair counts and 24h volume, published both filtered and unfiltered so the difference stays visible.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-stats",
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/{chain}/{pool}": {
      "get": {
        "summary": "One pair",
        "description": "A pair with both tokens hydrated, Solana mint/freeze authority where it applies, and the other pools trading the same token.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-chain-pool",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/{chain}/{pool}/candles": {
      "get": {
        "summary": "Pair candles",
        "description": "OHLCV for the pair, on the base side. Intervals 60, 300, 900, 3600, 14400, 86400.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-chain-pool-candles",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "60, 300, 900, 3600, 14400 or 86400 seconds. Default 300."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-1000, default 300."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO timestamp or epoch ms. WITH from, the response is the window STARTING there. Without it, the response is the most recent `limit` bars."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO timestamp or epoch ms."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Always ascending by bucketTs. With no `from`, this returns the LATEST `limit` bars — a chart means the most recent ones, and an ascending read with a limit would otherwise return the oldest (measured: base’s busiest pool at interval=60 came back six days stale). vUsd is NULL, not 0, when no trade in the bucket could be valued. buys and sells are NULL for buckets folded before the split was counted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/{chain}/{pool}/traders": {
      "get": {
        "summary": "Top traders",
        "description": "Which wallets are trading this pool, with their trade counts and buy/sell split — the signal that separates an organic market from a handful of bots.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-chain-pool-traders",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minutes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Window, 1-360, default 60. Bounded because this groups the raw tape by maker: one hour costs 172ms on Solana’s busiest pool and 24 hours costs 26.7 seconds."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-100, default 25."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/pairs/{chain}/{pool}/trades": {
      "get": {
        "summary": "Pair trades",
        "description": "The pair's own tape, newest first, from the index's raw swaps.",
        "tags": [
          "Screener (pairs)"
        ],
        "operationId": "get-api-v2-pairs-chain-pool-trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallet/{chain}/{address}": {
      "get": {
        "summary": "Wallet positions",
        "description": "Every token an address has traded, with net position, current value and average-cost PnL — from Stryke's own tape, not a vendor.",
        "tags": [
          "Wallets (first-party)"
        ],
        "operationId": "get-api-v2-wallet-chain-address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The wallet, in the chain's own address format."
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Window to look back over, default 168 (7 days). 0 means the whole retained tape (14 days) and is slower on high-frequency wallets."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Every figure is WINDOW-SCOPED. A position whose first trade predates the window has positionComplete:false and an understated cost basis. usdCoverage says what fraction of the trades the follower priced — 0 on eth and base, where no USD is written to the tape.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallet/{chain}/{address}/balances": {
      "get": {
        "summary": "Wallet balances",
        "description": "What the address actually HOLDS, read from the chain through Stryke’s own RPC — not what it traded.",
        "tags": [
          "Wallets (first-party)"
        ],
        "operationId": "get-api-v2-wallet-chain-address-balances",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The wallet, in the chain's own address format."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Holdings to return, 1-500, default 200. Sorted by value."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Every holding is returned and each carries `dust` (priced below dustBelowUsd) so a client can filter and say how many it hid — a balance the chain reports is never silently discarded, and an UNPRICED holding is not dust but unknown. coverage.complete says whether every held token could be listed. On Solana it is true — getTokenAccountsByOwner enumerates, and accounts are summed per mint. On EVM it is FALSE by construction: there is no way to list an address’s ERC-20s, so the candidate set is the tokens the index has seen it trade and an untraded airdrop will not appear. A holding whose price is not anchored carries priceUsd null rather than a price the feedback loop may have manufactured, so totalValueUsd is a floor rather than an estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/wallet/{chain}/{address}/trades": {
      "get": {
        "summary": "Wallet trades",
        "description": "The address's own tape, newest first.",
        "tags": [
          "Wallets (first-party)"
        ],
        "operationId": "get-api-v2-wallet-chain-address-trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-200, default 50."
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Look-back window, default 168."
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "'buy' or 'sell'."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/token/{chain}/{address}": {
      "get": {
        "summary": "Token overview",
        "description": "One token: identity, the price its deepest market sets, cross-pool totals, and every market it trades in.",
        "tags": [
          "Tokens (first-party)"
        ],
        "operationId": "get-api-v2-token-chain-address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "eth | base | sol."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The token, in the chain's own address format."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Markets to return, 1-200, default 50."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "price.source says which rule produced the number: 'anchored-token-price' is the token's own cross-pool price, published only when it was reached in one hop from a stablecoin or the wrapped native AND that hop crossed a pool with measured depth, and only when it is under 15 minutes old; 'deepest-measured-pool' is the fallback. price is NULL unless one of those holds — a price from a pool with no MEASURED depth — a price from an unmeasured pool is the exact failure mode the liquidity floor exists to stop. market.liquidityUsd and market.volume24hUsd describe the markets containing the token, counting both sides of each pool; each pool is counted once. authorities is present only on Solana, where a null authority means renounced.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/token/{chain}/{address}/pools": {
      "get": {
        "summary": "Token markets",
        "description": "Every pool the token trades in, deepest first, with the side it sits on.",
        "tags": [
          "Tokens (first-party)"
        ],
        "operationId": "get-api-v2-token-chain-address-pools",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-500, default 100."
          },
          {
            "name": "minLiquidityUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Default 0 — a token page must not hide a token's only market. Rows carry liquidityUsd and volTrusted so the caller can mark them."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/token/{chain}/{address}/candles": {
      "get": {
        "summary": "Token OHLCV",
        "description": "The token's cross-pool candle series — each bucket from that bucket's deepest eligible pool, never averaged.",
        "tags": [
          "Tokens (first-party)"
        ],
        "operationId": "get-api-v2-token-chain-address-candles",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "60, 300, 900, 3600, 14400 or 86400 seconds. Default 300."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-1000, default 300."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO timestamp or epoch ms."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO timestamp or epoch ms."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "buys and sells are NULL, not 0, for buckets folded before the builder counted the split. vUsd is NULL when no trade in the bucket could be valued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/token/{chain}/{address}/trades": {
      "get": {
        "summary": "Token tape",
        "description": "Every trade of one token across all its markets, newest first — not one pool's tape.",
        "tags": [
          "Tokens (first-party)"
        ],
        "operationId": "get-api-v2-token-chain-address-trades",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "1-200, default 50."
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Look-back window, default 24. The raw tape retains 14 days."
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "'buy' or 'sell', oriented to this token."
          },
          {
            "name": "minUsd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Floor on the trade value in dollars. On a chain whose follower prices its own swaps this is pushed into the query; where it does not (eth and base write no USD at all) the tape is valued at read time and filtered here, and `minUsdApplied` says which happened. When it is 'after-valuation', `scanned` says how many recent trades were examined — fewer results than `limit` at the scan cap means the window may hold more, further back."
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "usdCoverage says what fraction of the rows carry a dollar value. The EVM followers write NO USD to the tape (measured 0% on eth and base), so every figure there is derived at read time from token prices and each row's usdBasis says which: 'follower', 'derived' or 'unpriceable'.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v2/trade/pricing": {
      "get": {
        "summary": "Trade route costs",
        "description": "The declared cost and tier of every /api/v2/trade route, machine-readable. Units are the worst-case number of upstream round trips.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "get-api-v2-trade-pricing",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "routes[] is the per-route cost table: `units` is a dimensionless billing weight (1 = one cheap cached read), also stamped on every response of the family as the X-Stryke-Cost-Units header. enforcement.tiers is `declared-only` today: no tier denies a request that would otherwise succeed. Each row also carries an operator-facing `envOverride` name. The example shows two rows; the live answer lists every route of the family.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "enforcement": {
                      "type": "object",
                      "properties": {
                        "tiers": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "units": {
                            "type": "number"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "unit": "stryke-cost-units (dimensionless billing weight; 1 = one cheap cached read)",
                  "enforcement": {
                    "tiers": "declared-only",
                    "note": "units are declared and stamped on X-Stryke-Cost-Units; nothing debits a balance yet"
                  },
                  "routes": [
                    {
                      "route": "/api/v2/trade/quote",
                      "method": "POST",
                      "units": 3,
                      "tier": "public",
                      "note": "the engine detects the venue and builds an unsigned transaction to price it"
                    },
                    {
                      "route": "/api/v2/trade/tx/:chain/:hash",
                      "method": "GET",
                      "units": 1,
                      "tier": "public",
                      "note": "1 RPC call on Solana, 3 batched on EVM"
                    }
                  ],
                  "generatedAt": 1792000000000
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/trade/chains": {
      "get": {
        "summary": "Tradeable chains & execution modes",
        "description": "What can trade, and how. Each row: the chain's identity, its `actions`, `tradeable` (true only when the chain's engine actually answered a liveness check, not when a product is merely declared), a `custody` block naming which routes are non-custodial, the engine `service` status, and the full `execution` support matrix with what each mode buys and costs on that chain. Also returns the vocabulary and its defaults.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "get-api-v2-trade-chains",
        "parameters": [
          {
            "name": "probe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "`0` skips the liveness checks (service.status reads \"unprobed\")."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, vocabulary {priority, mev, nonce, slippageBps, maxFeeMultiple}, defaults, chains[] {chain, kind, chainId, displayName, nativeSymbol, nativeDecimals, actions, tradeable, service, custody, execution}, generatedAt }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/trade/quote": {
      "post": {
        "summary": "Quote a trade",
        "description": "Price a swap. NEVER signs, never broadcasts. Non-custodial: priced by building the real transaction through the engine and discarding it, so a quote can never come from a different route than the trade. The response echoes execution.requested next to execution.applied, so you can see what each portable word became natively.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "post-api-v2-trade-quote",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, chain, chainId, action, execution {requested, applied, notes}, passthrough, custody: \"none\", mutated: false, quote }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "the request or its execution block was refused (code: bad_execution, bad_execution_value, unknown_execution_field, slippage_below_chain_floor, slippage_above_chain_ceiling, bad_passthrough, passthrough_denied, passthrough_unknown, key_on_noncustodial_route …). Every one is permanent: retryable is always false"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain — the body lists the valid keys"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "execution_not_supported: that execution mode is not available on this chain"
          },
          "502": {
            "description": "the engine could not price it (quote_unavailable, retryable"
          },
          "503": {
            "description": "no engine configured for this chain, or it is down"
          },
          "504": {
            "description": "the engine did not answer in time (engine_unreachable / engine_timeout"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "description": "Chain key: sol, or an EVM key. GET /api/v2/trade/chains lists every key and whether its engine answers (`tradeable`). An unknown key is a 404 listing the valid keys — never a silent fall-through to Solana."
                  },
                  "action": {
                    "type": "string",
                    "description": "`buy` or `sell`; `maker` (one transaction that buys and sells through the same pool) on EVM chains only."
                  },
                  "token": {
                    "type": "string",
                    "description": "EVM: 0x + 40 hex. Solana: base58 mint. Alias: mint. Validated against the named chain."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "The PUBLIC address the trade is priced and built for. Required on quote too: a quote is priced by building the real transaction."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Native currency for a buy; token units or a percentage such as \"100%\" for a sell."
                  },
                  "execution": {
                    "type": "object",
                    "description": "The portable execution vocabulary: {priority: cheap|balanced|fast (default balanced), mev: none|protected (default none), nonce: none|durable (default none), slippageBps: integer (default 1000; per-chain floor and ceiling in GET /chains), maxFeeMultiple: number ≥ 1 (EVM only)}. Unknown fields are refused, never ignored. `fast` means SENT, not LANDED. `nonce: durable` is Solana /quote and /build only, with your own nonceAccount."
                  },
                  "passthrough": {
                    "type": "object",
                    "description": "Chain-native knobs, forwarded through a strict per-chain allowlist (GET /api/v2/trade/chains). Unknown fields are a 400 passthrough_unknown and fee-redirect fields are a 400 passthrough_denied — never silently dropped."
                  },
                  "nonceAccount": {
                    "type": "string",
                    "description": "Solana + execution.nonce \"durable\" only: YOUR OWN rent-exempt nonce account whose authority is `wallet`. Omitting it with durable is a 400 nonce_account_required."
                  }
                },
                "required": [
                  "chain",
                  "action",
                  "token",
                  "wallet",
                  "amount"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/trade/build": {
      "post": {
        "summary": "Build an unsigned transaction",
        "description": "An UNSIGNED transaction you sign yourself. Same contract and refusals as /quote. Returns unsignedTransaction.transactions[] — an ARRAY, because a Solana trade can legitimately be more than one transaction (sign and submit them IN ORDER). On EVM the payload carries to, data, value and chainId; nonce and gas are left to the signer. execution.nonce \"durable\" is available here (Solana) with a top-level nonceAccount.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "post-api-v2-trade-build",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, chain, chainId, action, execution, custody: \"none\", mutated: false, unsignedTransaction {transactions[]} }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "the request or its execution block was refused (code: bad_execution, bad_execution_value, unknown_execution_field, slippage_below_chain_floor, slippage_above_chain_ceiling, bad_passthrough, passthrough_denied, passthrough_unknown, key_on_noncustodial_route …). Every one is permanent: retryable is always false"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "execution_not_supported on this chain"
          },
          "502": {
            "description": "the engine could not build it"
          },
          "503": {
            "description": "no engine configured for this chain, or it is down"
          },
          "504": {
            "description": "the engine did not answer in time (engine_unreachable / engine_timeout"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "description": "Chain key: sol, or an EVM key. GET /api/v2/trade/chains lists every key and whether its engine answers (`tradeable`). An unknown key is a 404 listing the valid keys — never a silent fall-through to Solana."
                  },
                  "action": {
                    "type": "string",
                    "description": "`buy` or `sell`; `maker` (one transaction that buys and sells through the same pool) on EVM chains only."
                  },
                  "token": {
                    "type": "string",
                    "description": "EVM: 0x + 40 hex. Solana: base58 mint. Alias: mint. Validated against the named chain."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "The PUBLIC address the trade is priced and built for. Required on quote too: a quote is priced by building the real transaction."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Native currency for a buy; token units or a percentage such as \"100%\" for a sell."
                  },
                  "execution": {
                    "type": "object",
                    "description": "The portable execution vocabulary: {priority: cheap|balanced|fast (default balanced), mev: none|protected (default none), nonce: none|durable (default none), slippageBps: integer (default 1000; per-chain floor and ceiling in GET /chains), maxFeeMultiple: number ≥ 1 (EVM only)}. Unknown fields are refused, never ignored. `fast` means SENT, not LANDED. `nonce: durable` is Solana /quote and /build only, with your own nonceAccount."
                  },
                  "passthrough": {
                    "type": "object",
                    "description": "Chain-native knobs, forwarded through a strict per-chain allowlist (GET /api/v2/trade/chains). Unknown fields are a 400 passthrough_unknown and fee-redirect fields are a 400 passthrough_denied — never silently dropped."
                  },
                  "nonceAccount": {
                    "type": "string",
                    "description": "Solana + execution.nonce \"durable\" only: YOUR OWN rent-exempt nonce account whose authority is `wallet`. Omitting it with durable is a 400 nonce_account_required."
                  }
                },
                "required": [
                  "chain",
                  "action",
                  "token",
                  "wallet",
                  "amount"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/trade/relay": {
      "post": {
        "summary": "Broadcast a signed transaction",
        "description": "Broadcast a transaction YOU signed. Non-custodial, but a write, so it needs a per-customer key (shared keys are refused). Solana takes signedTransaction (base64) or signedTransactions[] (at most 250) plus `wallet`, which must be the FEE PAYER of every transaction. EVM takes EXACTLY ONE signedTransaction (0x raw hex) and refuses a batch: a partially broadcast batch from one account leaves a nonce gap. A failure can be AMBIGUOUS — see the `ambiguous` field.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "post-api-v2-trade-relay",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, chain, chainId, custody: \"none\", … the engine's broadcast result }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad payload, a private key on a non-custodial route, a missing fee-payer wallet, or an EVM batch"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: shared keys cannot relay"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          },
          "504": {
            "description": "AMBIGUOUS: the transaction may still land — reconcile with GET /api/v2/trade/tx/{chain}/{hash}, do not re-send"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "description": "Chain key: sol, or an EVM key. GET /api/v2/trade/chains lists every key and whether its engine answers (`tradeable`). An unknown key is a 404 listing the valid keys — never a silent fall-through to Solana."
                  },
                  "signedTransaction": {
                    "type": "string",
                    "description": "EVM: 0x-prefixed raw signed transaction hex (required). Solana: one base64 transaction."
                  },
                  "signedTransactions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Solana only: base64 transactions, at most 250, broadcast in order. Refused on EVM."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "Solana: required, and must be the fee payer of every transaction."
                  }
                },
                "required": [
                  "chain"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/trade/send": {
      "post": {
        "summary": "Sign and send (custodial, first-party only)",
        "description": "CUSTODIAL: the one route that receives a private key, signs and broadcasts. Not available to customer keys — it is closed by default and opens only for keys an operator has explicitly allowlisted, and never for a shared key. If you do not want to hand over a key, use POST /build then POST /relay: on that path the key never leaves your side. execution.nonce \"durable\" is 501 here.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "post-api-v2-trade-send",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, chain, chainId, action, execution, custody: \"first-party\", mutated: true, principal, result }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "the request or its execution block was refused (code: bad_execution, bad_execution_value, unknown_execution_field, slippage_below_chain_floor, slippage_above_chain_ceiling, bad_passthrough, passthrough_denied, passthrough_unknown, key_on_noncustodial_route …). Every one is permanent: retryable is always false"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "not_first_party (the key is not on the operator allowlist) or shared_key_cannot_own_orders"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "execution.nonce \"durable\" is not supported on send"
          },
          "503": {
            "description": "engine down, or FEE_CAP_EXCEEDED — a refusal, not a failure; retry when gas falls"
          },
          "504": {
            "description": "AMBIGUOUS: reconcile with GET /api/v2/trade/tx/{chain}/{hash}, never re-send"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "description": "Chain key: sol, or an EVM key. GET /api/v2/trade/chains lists every key and whether its engine answers (`tradeable`). An unknown key is a 404 listing the valid keys — never a silent fall-through to Solana."
                  },
                  "action": {
                    "type": "string",
                    "description": "`buy` or `sell`; `maker` (one transaction that buys and sells through the same pool) on EVM chains only."
                  },
                  "token": {
                    "type": "string",
                    "description": "EVM: 0x + 40 hex. Solana: base58 mint. Alias: mint. Validated against the named chain."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "The PUBLIC address the trade is priced and built for. Required on quote too: a quote is priced by building the real transaction."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Native currency for a buy; token units or a percentage such as \"100%\" for a sell."
                  },
                  "execution": {
                    "type": "object",
                    "description": "The portable execution vocabulary: {priority: cheap|balanced|fast (default balanced), mev: none|protected (default none), nonce: none|durable (default none), slippageBps: integer (default 1000; per-chain floor and ceiling in GET /chains), maxFeeMultiple: number ≥ 1 (EVM only)}. Unknown fields are refused, never ignored. `fast` means SENT, not LANDED. `nonce: durable` is Solana /quote and /build only, with your own nonceAccount."
                  },
                  "passthrough": {
                    "type": "object",
                    "description": "Chain-native knobs, forwarded through a strict per-chain allowlist (GET /api/v2/trade/chains). Unknown fields are a 400 passthrough_unknown and fee-redirect fields are a 400 passthrough_denied — never silently dropped."
                  },
                  "privateKey": {
                    "type": "string",
                    "description": "The signing key. Never logged, and scrubbed from every message that leaves the engine adapters."
                  }
                },
                "required": [
                  "chain",
                  "action",
                  "token",
                  "wallet",
                  "amount",
                  "privateKey"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/trade/tx/{chain}/{hash}": {
      "get": {
        "summary": "Is it settled?",
        "description": "The reconciliation route, and the reason an ambiguous send is safe to HOLD rather than retry. `found: false` means the chain has never seen this transaction — NOT that it failed; those lead to opposite decisions. States: confirmed, finalized, pending, failed, reverted, submitted, submitted_unconfirmed, jito_accepted, unverified, unknown. `jito_accepted` and `unverified` are NOT settlement: acceptance is not inclusion.",
        "tags": [
          "Trade (Solana + EVM)"
        ],
        "operationId": "get-api-v2-trade-tx-chain-hash",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Chain key: sol, or an EVM key. GET /api/v2/trade/chains lists every key and whether its engine answers (`tradeable`). An unknown key is a 404 listing the valid keys — never a silent fall-through to Solana."
          },
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana: the transaction signature. EVM: 0x + 64 hex."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, chain, chainId, found, status, …, explorerUrl (EVM) }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed hash for this chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/pricing": {
      "get": {
        "summary": "EVM route costs",
        "description": "The declared cost and tier of every /api/v2/evm route, machine-readable. Served from memory (0 units).",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-pricing",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "routes[] is the per-route cost table: `units` is a dimensionless billing weight (1 = one cheap cached read), also stamped on every response of the family as the X-Stryke-Cost-Units header. enforcement.tiers is `declared-only` today: no tier denies a request that would otherwise succeed. Each row also carries an operator-facing `envOverride` name. The example shows two rows; the live answer lists every route of the family.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "enforcement": {
                      "type": "object",
                      "properties": {
                        "tiers": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "units": {
                            "type": "number"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "unit": "stryke-cost-units (dimensionless billing weight; 1 = one cheap cached read)",
                  "enforcement": {
                    "tiers": "declared-only",
                    "note": "units are declared and stamped on X-Stryke-Cost-Units; nothing debits a balance yet"
                  },
                  "routes": [
                    {
                      "route": "/api/v2/evm/chains",
                      "method": "GET",
                      "units": 1,
                      "tier": "public",
                      "note": "registry + a cached local health probe per configured service"
                    },
                    {
                      "route": "/api/v2/evm/token/:chain/:address",
                      "method": "GET",
                      "units": 4,
                      "tier": "public",
                      "note": "metadata + venue detection + per-pool reserves"
                    }
                  ],
                  "generatedAt": 1792000000000
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/chains": {
      "get": {
        "summary": "Supported EVM chains",
        "description": "Every EVM chain in the registry with its chain id, native and wrapped-native asset, venues, Uniswap V3 fee tiers, which venues this API can quote over JSON-RPC (`rpcQuotableVenues` — V4 pools are not RPC-quotable here), chain physics, and the status of its trade service. `readOnly: true` rows have no execution path. Per-product liveness is reported as unknown (null) rather than guessed.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-chains",
        "parameters": [
          {
            "name": "probe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "`0` skips the cached local trade-service health probe."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, count, chains[] } — each row: key, chainId, name, readOnly, native {symbol, decimals, wrapped, priceAsset}, venues, v3FeeTiers, rpcQuotableVenues, physics, tradeService, products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/token/{chain}/{address}": {
      "get": {
        "summary": "EVM token report",
        "description": "ERC-20 metadata, the venues the token trades on, native-side liquidity per pool, and tradeability. Tradeability comes from a simulated round trip through the real venue where a trade service is configured (the atomic one-transaction verdict is reported separately from the two-transaction one); otherwise from what RPC can prove (factory pool lookups plus live buy and sell quotes), and `method` says which. An unmeasured token reports `unknown`, never a confident `false`.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-token-chain-address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token contract — a 0x-prefixed 20-byte hex address."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "auto"
            },
            "description": "`auto` (default): the trade service if it answers, JSON-RPC otherwise, and `method` in the response says which answered. `service`: only the trade-service answer — 501 when there is none, so a pre-payment decision can refuse the weaker answer. `rpc`: only direct JSON-RPC, for cross-checking."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "`liquidity` is the NATIVE-SIDE RESERVE — the wrapped-native balance held by each pool contract, read on-chain. It is not a USD TVL and must not be added to one. A Uniswap V4 venue reports null with a reason rather than 0 (per-pool V4 inventory is not an ERC-20 balance).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed address, bad source, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain, or no ERC-20 at this address on this chain"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "source=service and no trade service is reachable for this chain"
          }
        }
      }
    },
    "/api/v2/evm/price/{chain}/{address}": {
      "get": {
        "summary": "EVM token price",
        "description": "Spot price of a token in the native asset and in USD, measured as a quote at a SIZE (the probe amount is a parameter and is echoed back as `probe`). Sources are tried trade-service first, then the on-chain quoters. A chain with no verified stable pair borrows the native/USD rate from the asset's home chain, and `nativeUsdSource.borrowed` says so. `crossCheck` is an independent second read of the same market when one exists — a comparison, not a correction.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-price-chain-address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token contract — a 0x-prefixed 20-byte hex address."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "0.01"
            },
            "description": "Probe size in the native asset. The price is a function of it."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "auto"
            },
            "description": "`auto` (default): the trade service if it answers, JSON-RPC otherwise, and `method` in the response says which answered. `service`: only the trade-service answer — 501 when there is none, so a pre-payment decision can refuse the weaker answer. `rpc`: only direct JSON-RPC, for cross-checking."
          },
          {
            "name": "crossCheck",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "`0` skips the independent second read."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed address, bad source or amount, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain, or no venue on this chain quoted the pair"
          },
          "422": {
            "description": "the address does not answer decimals() on this chain"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "source=service and no trade service is reachable"
          }
        }
      }
    },
    "/api/v2/evm/quote/{chain}": {
      "get": {
        "summary": "EVM swap quote",
        "description": "Exact-in swap quote between any two assets on one chain. Every RPC-quotable venue is asked concurrently and every attempt is returned, successes and failures alike, with the best one picked — first-to-answer can be wrong by real money. Uniswap V4 is not quotable here: a V4-only market answers 404 with a note pointing at /token and /price. Quote only — never builds calldata, never signs.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-quote-chain",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "in",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`native`, the chain's native symbol, or a 0x token address. Native quotes through the wrapped form, which is what the router uses."
          },
          {
            "name": "out",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Same forms as `in`; must resolve to a different asset."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Decimal amount in INPUT-asset units. More precision than the asset has is rejected, never truncated. One of amount or amountRaw is required."
          },
          {
            "name": "amountRaw",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The amount in base units (a non-negative integer), instead of `amount`."
          },
          {
            "name": "slippageBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100
            },
            "description": "0–10000."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad in/out/amount/slippageBps, the same asset twice, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain, or no venue quoted this pair (the body lists every attempt"
          },
          "422": {
            "description": "an asset does not answer decimals() on this chain"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/wallet/{chain}/{address}": {
      "get": {
        "summary": "EVM wallet balances",
        "description": "Native balance, plus ERC-20 balances for the tokens you name. There is deliberately no \"every token this wallet holds\": enumerating holdings needs an indexer or a log scan public RPCs refuse, and claiming to enumerate would silently return a partial list. Balances are exact decimal strings, never doubles.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-wallet-chain-address",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet — a 0x-prefixed 20-byte hex address."
          },
          {
            "name": "tokens",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated 0x token addresses, at most 25."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed address, more than 25 tokens, a non-address in tokens, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/tx/{chain}/{hash}": {
      "get": {
        "summary": "EVM transaction status",
        "description": "Status, confirmations and the true fee paid. `totalFeeWei` is gasUsed × effectiveGasPrice PLUS the L1 data fee on chains that charge one (OP-stack and Arbitrum receipts carry it separately). Confirmations are computed from the receipt against the chain's own block number.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-tx-chain-hash",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed 32-byte transaction hash."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed hash, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain, or the node has no record of this hash — which is NOT the same as the transaction having failed"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/evm/gas/{chain}": {
      "get": {
        "summary": "EVM gas snapshot",
        "description": "Gas price, base fee, and the L1 data fee where one applies. Does not price a swap: pass `gas` to cost out a number of gas units you already hold. A missing base fee means pre-EIP-1559; a literal zero (BNB Smart Chain) stays zero. `source: registry-fallback` flags a last-resort value used when every RPC read failed. Compare chains on `estimate.totalUsd`, never on gwei.",
        "tags": [
          "EVM chains (per-chain reads)"
        ],
        "operationId": "get-api-v2-evm-gas-chain",
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM chain key, e.g. eth, base, bsc, arb, polygon. GET /api/v2/evm/chains lists every key (25 today, of which the read-only rows have no trade path). An unknown key is a 404; a non-EVM key (sol) is a 400 pointing at the Solana routes."
          },
          {
            "name": "gas",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Gas units to cost out; a positive integer up to 50,000,000."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad gas value, or a non-EVM chain"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "404": {
            "description": "unknown chain"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/services/pricing": {
      "get": {
        "summary": "Services route costs",
        "description": "The declared cost and tier of every /api/v2/services route. Static metadata with no order data — the one services route a shared key may read.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "get-api-v2-services-pricing",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "routes[] is the per-route cost table: `units` is a dimensionless billing weight (1 = one cheap cached read), also stamped on every response of the family as the X-Stryke-Cost-Units header. enforcement.tiers is `declared-only` today: no tier denies a request that would otherwise succeed. Each row also carries an operator-facing `envOverride` name. The example shows two rows; the live answer lists every route of the family.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "enforcement": {
                      "type": "object",
                      "properties": {
                        "tiers": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "route": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "units": {
                            "type": "number"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "generatedAt": {
                      "type": "number"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "unit": "stryke-cost-units (dimensionless billing weight; 1 = one cheap cached read)",
                  "enforcement": {
                    "tiers": "declared-only",
                    "note": "units are declared and stamped on X-Stryke-Cost-Units; nothing debits a balance yet"
                  },
                  "routes": [
                    {
                      "route": "/api/v2/services/catalog",
                      "method": "GET",
                      "units": 1,
                      "tier": "public",
                      "note": "one upstream read of the live product x chain matrix"
                    },
                    {
                      "route": "/api/v2/services/order",
                      "method": "POST",
                      "units": 5,
                      "tier": "public",
                      "note": "upstream prices, mints a deposit wallet and writes three rows"
                    }
                  ],
                  "generatedAt": 1792000000000
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "429": {
            "description": "rate limited"
          }
        }
      }
    },
    "/api/v2/services/catalog": {
      "get": {
        "summary": "Orderable products × chains",
        "description": "What can ACTUALLY be ordered right now. `catalog[]` is the ordering service's own live verdict per product × chain (capability AND the operator's go-live switches). `capability[]` is the weaker claim that a chain has a code path for a product (EVM rows report orderable: null because this API cannot see the switches). `products[]` is the request vocabulary: each product's target field, its bounds and its optional fields.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "get-api-v2-services-catalog",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        }
      }
    },
    "/api/v2/services/quote": {
      "post": {
        "summary": "Quote an order",
        "description": "Price one order in the chain's native asset. A quote is NOT an entitlement: availability is re-checked when the order is created, so a successful quote can still be refused at order time. `amount_label` names the chain as well as the ticker (several chains use ETH).",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "post-api-v2-services-quote",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, quote } — the price in the chain's native asset, with amount_label.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "409": {
            "description": "PERMANENT refusal (permanent: true, retryable: false): no venue, honeypot, too illiquid, the product is not live on that chain, or below the chain's minimum order (the one kind the caller can clear, by ordering more — actionable: true"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product": {
                    "type": "string",
                    "description": "volume_bot, makers_bot, holders_bot or bump_bot (short aliases volume, makers, holders, bump/bumps are accepted). Anything else is a 400 listing the valid values."
                  },
                  "chain": {
                    "type": "string",
                    "description": "Chain key (sol, or an EVM key such as eth, bsc, base, arb, polygon). Required and never defaulted; unknown is a 400. GET /api/v2/services/catalog says which product × chain pairs can actually be ordered now."
                  },
                  "contract_address": {
                    "type": "string",
                    "description": "The token: a 0x 20-byte address on an EVM chain, a base58 mint on Solana. Validated against the chain named above. Aliases: mint, token."
                  },
                  "target_volume_usd": {
                    "type": "number",
                    "description": "volume_bot target, in USD."
                  },
                  "target_makers": {
                    "type": "integer",
                    "description": "makers_bot target."
                  },
                  "target_holders": {
                    "type": "integer",
                    "description": "holders_bot target."
                  },
                  "target_txs": {
                    "type": "integer",
                    "description": "bump_bot target (target_txs, not target_bumps)."
                  },
                  "target": {
                    "type": "number",
                    "description": "Shorthand accepted in place of the product-specific target field. Bounds per product are in GET /api/v2/services/catalog (products[].target_min / target_max)."
                  },
                  "speed": {
                    "type": "string",
                    "description": "slow, chill, normal, fast or fastest."
                  },
                  "duration_hours": {
                    "type": "number",
                    "description": "volume_bot: run length in hours (positive)."
                  },
                  "target_hours": {
                    "type": "number",
                    "description": "makers_bot / holders_bot / bump_bot: run length in hours (positive)."
                  },
                  "min_trade_usd": {
                    "type": "number",
                    "description": "volume_bot: smallest trade, USD (positive)."
                  },
                  "max_trade_usd": {
                    "type": "number",
                    "description": "volume_bot: largest trade, USD (positive)."
                  }
                },
                "required": [
                  "product",
                  "chain",
                  "contract_address"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/services/order": {
      "post": {
        "summary": "Create an order",
        "description": "Create the order and get the deposit address to pay it. This does NOT take payment: send exactly `amount` of `currency` ON THE NAMED CHAIN to `deposit_address` (or scan `payment_uri`, whose EIP-681 chain id makes a wallet switch networks). The deposit is detected and the order activates. Pay the amount EXACTLY — paying less leaves the order pending. Send an Idempotency-Key header (max 128 chars) to make retries safe; creation is also idempotent per key, product, chain and token while an order is pending, and `reused: true` says so. `expires_at` is null when the ordering service declares none.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "post-api-v2-services-order",
        "parameters": [],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 201 { success, order } — order carries the id, status, amount, currency, deposit_address, payment_uri, expires_at and reused.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "409": {
            "description": "PERMANENT refusal: see POST /quote"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "502": {
            "description": "ownership_mismatch: the ordering service returned an order not stamped for this key; no deposit address is handed over"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product": {
                    "type": "string",
                    "description": "volume_bot, makers_bot, holders_bot or bump_bot (short aliases volume, makers, holders, bump/bumps are accepted). Anything else is a 400 listing the valid values."
                  },
                  "chain": {
                    "type": "string",
                    "description": "Chain key (sol, or an EVM key such as eth, bsc, base, arb, polygon). Required and never defaulted; unknown is a 400. GET /api/v2/services/catalog says which product × chain pairs can actually be ordered now."
                  },
                  "contract_address": {
                    "type": "string",
                    "description": "The token: a 0x 20-byte address on an EVM chain, a base58 mint on Solana. Validated against the chain named above. Aliases: mint, token."
                  },
                  "target_volume_usd": {
                    "type": "number",
                    "description": "volume_bot target, in USD."
                  },
                  "target_makers": {
                    "type": "integer",
                    "description": "makers_bot target."
                  },
                  "target_holders": {
                    "type": "integer",
                    "description": "holders_bot target."
                  },
                  "target_txs": {
                    "type": "integer",
                    "description": "bump_bot target (target_txs, not target_bumps)."
                  },
                  "target": {
                    "type": "number",
                    "description": "Shorthand accepted in place of the product-specific target field. Bounds per product are in GET /api/v2/services/catalog (products[].target_min / target_max)."
                  },
                  "speed": {
                    "type": "string",
                    "description": "slow, chill, normal, fast or fastest."
                  },
                  "duration_hours": {
                    "type": "number",
                    "description": "volume_bot: run length in hours (positive)."
                  },
                  "target_hours": {
                    "type": "number",
                    "description": "makers_bot / holders_bot / bump_bot: run length in hours (positive)."
                  },
                  "min_trade_usd": {
                    "type": "number",
                    "description": "volume_bot: smallest trade, USD (positive)."
                  },
                  "max_trade_usd": {
                    "type": "number",
                    "description": "volume_bot: largest trade, USD (positive)."
                  }
                },
                "required": [
                  "product",
                  "chain",
                  "contract_address"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v2/services/order/{id}": {
      "get": {
        "summary": "Get an order",
        "description": "One order — status, progress, delivered versus target. Scoped to the calling key: an order belonging to another key answers 404, the same as an id that does not exist.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "get-api-v2-services-order-id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Order id (positive integer)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "404": {
            "description": "no order with this id belongs to your key"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        }
      }
    },
    "/api/v2/services/order/{id}/cancel": {
      "post": {
        "summary": "Cancel an order",
        "description": "Cancel an order and start its pro-rata refund. Ownership is verified BEFORE the cancel is issued. `refund` is an INTENT, not a settled payment — it runs asynchronously, so refund.status is typically `queued`. Cancel is idempotent: a repeated cancel does not refund twice. The refund amount is computed by the ordering service, not by this API.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "post-api-v2-services-order-id-cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Order id (positive integer)."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, order_id, status (\"cancelled\"), refund (intent or null), chain }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "404": {
            "description": "no order with this id belongs to your key"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        }
      }
    },
    "/api/v2/services/orders": {
      "get": {
        "summary": "List orders",
        "description": "Every order belonging to the calling key, scoped upstream and filtered again here. `foreign_rows_dropped` is normally 0; non-zero means a row this key does not own came back and was dropped.",
        "tags": [
          "Market services (orders)"
        ],
        "operationId": "get-api-v2-services-orders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by status (max 32 characters)."
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by product (canonical name or alias)."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by chain key."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "1–200; anything else falls back to 50."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, count, orders[], foreign_rows_dropped }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "malformed request, rejected before any upstream call; the body names the field and, where it applies, the valid values"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "shared_key_cannot_own_orders: this key has a shared identity (the public preview key and the site proxy key) and cannot own orders — use a per-customer key"
          },
          "429": {
            "description": "rate limited"
          },
          "501": {
            "description": "the ordering service has not shipped the operation this route proxies, or no service credential is configured — never a stubbed success"
          },
          "503": {
            "description": "the ordering service is unreachable or rate limiting; retryable: true"
          }
        }
      }
    },
    "/api/v2/usage": {
      "get": {
        "summary": "Month-to-date usage",
        "description": "Month-to-date credits, totals and limits for the calling key or its account: plan, period, credits used/allowance/remaining, call totals (calls, rate-limited, auth failures, upstream errors, bytes out), a per-product and (scope=account) per-key breakdown, limits, alerts and freshness.",
        "tags": [
          "Usage & credits"
        ],
        "operationId": "get-api-v2-usage",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "UTC calendar month, YYYY-MM. Default: the current month."
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "account"
            },
            "description": "`account` (default) or `key`. Planned keys only; older keys always read their own key."
          },
          {
            "name": "limits",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "`0` omits limits.key for scope=account."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Top-level fields: success, subject {account, keyId, keyHint, pool, scope}, plan {id, monthlyCredits, overage soft|hard} (null for older keys), period {month, from, to}, credits {used, allowance, remaining, usedPct}, totals {calls, limited, authFailures, upstreamErrors, bytesOut}, byProduct[], byKey[] (scope=account only), limits, alerts[], freshness {asOf, lastFlushAt, pendingFlushMs, rollupAt}, and source (\"hour\" or \"day\": which rows the totals were read from — a month that began before the 90-day hourly retention is read from day rows). Latency quantiles are reported as the upper bound of the histogram bucket holding them.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unknown, repeated or over-long parameter: {\"success\":false,\"error\":\"<field>: <reason>\"}"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "the key cannot read usage (planned key without usage:read"
          },
          "429": {
            "description": "rate limited"
          },
          "503": {
            "description": "usage temporarily unavailable"
          }
        }
      }
    },
    "/api/v2/usage/daily": {
      "get": {
        "summary": "Daily usage rows",
        "description": "One row per UTC day and group, for at most 93 days. Days before today come from the daily roll-up once it has run past them (from hourly rows until then); today always comes from hourly rows and is marked partial. Sorted by day, then by the group value. Every group is returned — a day with more than 5,000 groups is a 400, never a cut list.",
        "tags": [
          "Usage & credits"
        ],
        "operationId": "get-api-v2-usage-daily",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: the first day of the month of `to`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today (UTC)."
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "product"
            },
            "description": "`product` (default), `key` or `class`."
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter to one product: rpc, compat, data or stream."
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "account"
            },
            "description": "`account` (default) or `key`."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rows carry day, the group fields, calls, credits, limited, upstream, bytesOut and partial.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad parameter, a range over 93 days, or too many groups for one day"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "the key cannot read usage"
          },
          "429": {
            "description": "rate limited"
          },
          "503": {
            "description": "usage temporarily unavailable"
          }
        }
      }
    },
    "/api/v2/usage/hourly": {
      "get": {
        "summary": "Hourly usage rows",
        "description": "One row per hour and group for a single UTC day. Hourly rows are kept for 90 days.",
        "tags": [
          "Usage & credits"
        ],
        "operationId": "get-api-v2-usage-hourly",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: today (UTC)."
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "product"
            },
            "description": "`product` (default) or `key`."
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "account"
            },
            "description": "`account` (default) or `key`."
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rows carry hour, the group fields, calls, credits, limited, upstream and bytesOut.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad parameter"
          },
          "401": {
            "description": "missing or invalid X-API-Key"
          },
          "403": {
            "description": "the key cannot read usage"
          },
          "404": {
            "description": "the date is older than the 90-day hourly retention"
          },
          "429": {
            "description": "rate limited"
          },
          "503": {
            "description": "usage temporarily unavailable"
          }
        }
      }
    }
  }
}