{"openapi":"3.1.0","info":{"title":"ELYVX Preview API","version":"0.1.0-preview","description":"Public REST API for the ELYVX structured markets preview. Market data is live from Hyperliquid. NAVs are engine estimates, history is simulation on real daily closes, and mint and redeem settle on a preview ledger with no on-chain settlement.","license":{"name":"Proprietary (preview)"}},"servers":[{"url":"https://www.elyvx.com","description":"Production preview"}],"tags":[{"name":"Markets"},{"name":"Data"},{"name":"Simulation"},{"name":"Preview"},{"name":"Auth"},{"name":"Protocol"}],"paths":{"/api/health":{"get":{"tags":["Protocol"],"summary":"Service health","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Health"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"207":{"description":"Degraded","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Health"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}}}}},"/api/markets":{"get":{"tags":["Markets"],"summary":"List structured markets","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"markets":{"type":"array","items":{"$ref":"#/components/schemas/MarketSummary"}},"unavailable":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"message":{"type":"string"}}}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/markets/{id}":{"get":{"tags":["Markets"],"summary":"Market detail","parameters":[{"name":"id","in":"path","required":true,"description":"Market slug","schema":{"type":"string","enum":["ai-bull","crypto-bull","crypto-bear","hype-bull","macro","market-neutral"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/Product"},"summary":{"$ref":"#/components/schemas/MarketSummary"},"nav":{"$ref":"#/components/schemas/NavSnapshot"},"composition":{"type":"array","items":{"$ref":"#/components/schemas/CompositionRow"}},"risk":{"$ref":"#/components/schemas/RiskMetrics"},"maxSupportedLeverage":{"type":"number"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/markets/{id}/nav":{"get":{"tags":["Markets"],"summary":"Live NAV estimate","parameters":[{"name":"id","in":"path","required":true,"description":"Market slug","schema":{"type":"string","enum":["ai-bull","crypto-bull","crypto-bear","hype-bull","macro","market-neutral"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/NavSnapshot"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/markets/{id}/history":{"get":{"tags":["Markets"],"summary":"Simulated NAV history","parameters":[{"name":"id","in":"path","required":true,"description":"Market slug","schema":{"type":"string","enum":["ai-bull","crypto-bull","crypto-bear","hype-bull","macro","market-neutral"]}},{"name":"days","in":"query","schema":{"type":"integer","minimum":7,"maximum":365,"default":365}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/History"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/markets/{id}/composition":{"get":{"tags":["Markets"],"summary":"Live composition","parameters":[{"name":"id","in":"path","required":true,"description":"Market slug","schema":{"type":"string","enum":["ai-bull","crypto-bull","crypto-bear","hype-bull","macro","market-neutral"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"leverage":{"type":"number"},"rebalance":{"$ref":"#/components/schemas/RebalanceMode"},"legs":{"type":"array","items":{"$ref":"#/components/schemas/CompositionRow"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/markets/{id}/risk":{"get":{"tags":["Markets"],"summary":"Risk metrics and stress tests","parameters":[{"name":"id","in":"path","required":true,"description":"Market slug","schema":{"type":"string","enum":["ai-bull","crypto-bull","crypto-bear","hype-bull","macro","market-neutral"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"metrics":{"$ref":"#/components/schemas/RiskMetrics"},"stress":{"type":"array","items":{"$ref":"#/components/schemas/StressResult"}},"volatilityDecay":{"type":"number"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/assets":{"get":{"tags":["Data"],"summary":"Verified asset registry","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/Asset"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/prices":{"get":{"tags":["Data"],"summary":"Live quotes","parameters":[{"name":"ids","in":"query","description":"Comma-separated asset IDs, e.g. BTC,NVDA","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"quotes":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AssetQuote"}},"fetchedAt":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/wallet/{address}":{"get":{"tags":["Data"],"summary":"On-chain balances (Elysium, HyperEVM) and HyperCore account","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/WalletBalances"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/protocol/stats":{"get":{"tags":["Protocol"],"summary":"Protocol and preview ledger statistics","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ProtocolStats"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/baskets/simulate":{"post":{"tags":["Simulation"],"summary":"Simulate a custom basket","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["basket"],"properties":{"basket":{"$ref":"#/components/schemas/BasketConfig"},"days":{"type":"integer","minimum":30,"maximum":365,"default":365}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","description":"Simulation, risk, stress, composition, NAV and rebalance plan"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable (asset unavailable or leverage unsupported)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/rebalance/simulate":{"post":{"tags":["Simulation"],"summary":"Rebalance plan for a market or custom basket","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Provide exactly one of slug or basket","properties":{"slug":{"type":"string"},"basket":{"$ref":"#/components/schemas/BasketConfig"},"equityUsd":{"type":"number","default":10000}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/RebalancePlan"},"history":{"type":"array","items":{"type":"object"}},"totalRebalances":{"type":"integer"},"totalExecutionCostPct":{"type":"number"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable (asset unavailable or leverage unsupported)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/baskets":{"get":{"tags":["Preview"],"summary":"List saved baskets","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"baskets":{"type":"array","items":{"$ref":"#/components/schemas/SavedBasket"}}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/baskets/create":{"post":{"tags":["Preview"],"summary":"Save a basket","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketConfig"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"basket":{"$ref":"#/components/schemas/SavedBasket"},"shareUrl":{"type":"string"},"savedUrl":{"type":"string"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/baskets/{id}":{"get":{"tags":["Preview"],"summary":"Get a saved basket configuration","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"config":{"$ref":"#/components/schemas/BasketConfig"},"createdAt":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Preview"],"summary":"Delete a saved basket","security":[{"sessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/portfolio":{"get":{"tags":["Preview"],"summary":"Preview portfolio for the current session","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/quotes/mint":{"post":{"tags":["Preview"],"summary":"Signed mint quote (30s TTL)","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","amountUsd"],"properties":{"slug":{"type":"string"},"amountUsd":{"type":"string","pattern":"^\\d+(\\.\\d{1,6})?$","description":"10 – 1,000,000 pUSD"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Quote"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/quotes/redeem":{"post":{"tags":["Preview"],"summary":"Signed redeem quote (30s TTL)","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","shares"],"properties":{"slug":{"type":"string"},"shares":{"type":"string","pattern":"^\\d+(\\.\\d{1,6})?$"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Quote"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/preview/mint":{"post":{"tags":["Preview"],"summary":"Settle a mint quote on the preview ledger","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteRequest"}}}},"responses":{"200":{"description":"Replayed (already settled)","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ExecutionResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"201":{"description":"Settled","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ExecutionResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict or expired quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/preview/redeem":{"post":{"tags":["Preview"],"summary":"Settle a redeem quote on the preview ledger","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteRequest"}}}},"responses":{"200":{"description":"Replayed (already settled)","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ExecutionResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"201":{"description":"Settled","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ExecutionResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict or expired quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/auth/nonce":{"post":{"tags":["Auth"],"summary":"Request a Sign-In with Ethereum message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string"},"chainId":{"type":"integer","default":99901}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","properties":{"message":{"type":"string"},"expiresAt":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/auth/privy":{"post":{"tags":["Auth"],"summary":"Exchange a Privy access token for a session (used by the app's sign-in)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accessToken"],"properties":{"accessToken":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Session"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream market data unavailable or prices stale","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/auth/verify":{"post":{"tags":["Auth"],"summary":"Verify the signed message and start a wallet session","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","message","signature"],"properties":{"address":{"type":"string"},"message":{"type":"string"},"signature":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Session"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/auth/session":{"get":{"tags":["Auth"],"summary":"Current session","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Session"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}}}},"delete":{"tags":["Auth"],"summary":"Sign out","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Session"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}}}}},"/api/openapi.json":{"get":{"tags":["Protocol"],"summary":"This OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 document"}}}}},"components":{"securitySchemes":{"sessionCookie":{"type":"apiKey","in":"cookie","name":"elyvx_session","description":"httpOnly session cookie set by /api/auth/privy (app sign-in) or /api/auth/verify (wallet signature)"}},"schemas":{"Provenance":{"type":"string","enum":["live","onchain","estimate","simulation","preview","proposed"]},"Meta":{"type":"object","required":["timestamp"],"properties":{"timestamp":{"type":"integer"},"provenance":{"$ref":"#/components/schemas/Provenance"},"source":{"type":"string"},"stale":{"type":"boolean"}}},"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","BAD_REQUEST","NOT_FOUND","UNAUTHENTICATED","FORBIDDEN","RATE_LIMITED","STALE_PRICES","QUOTE_EXPIRED","INVALID_QUOTE","INSUFFICIENT_BALANCE","INSUFFICIENT_SHARES","ASSET_UNAVAILABLE","LEVERAGE_UNSUPPORTED","UPSTREAM_UNAVAILABLE","CONFLICT","PAYLOAD_TOO_LARGE","INVALID_ADDRESS","SIGNATURE_INVALID","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{}}}}},"RebalanceMode":{"type":"string","enum":["daily","weekly","threshold","none"]},"BasketLeg":{"type":"object","required":["assetId","direction","weight"],"properties":{"assetId":{"type":"string","examples":["BTC","NVDA"]},"direction":{"type":"string","enum":["long","short"]},"weight":{"type":"number","exclusiveMinimum":0,"maximum":100,"description":"Relative weight; normalized to sum to 1"}}},"BasketConfig":{"type":"object","required":["legs","leverage"],"properties":{"name":{"type":"string","maxLength":40,"default":"Custom basket"},"legs":{"type":"array","minItems":1,"maxItems":12,"items":{"$ref":"#/components/schemas/BasketLeg"}},"leverage":{"type":"number","minimum":0.25,"maximum":5},"rebalance":{"$ref":"#/components/schemas/RebalanceMode"},"driftThreshold":{"type":"number","minimum":0.01,"maximum":0.5,"default":0.1}}},"Asset":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"name":{"type":"string"},"assetClass":{"type":"string","enum":["crypto","equity","commodity","index","fx"]},"venue":{"type":"string","enum":["hyperliquid-core","hyperliquid-hip3"]},"dex":{"type":"string"},"sector":{"type":"string"},"available":{"type":"boolean"},"maxLeverage":{"type":["number","null"]}}},"AssetQuote":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"markPx":{"type":"number"},"midPx":{"type":["number","null"]},"oraclePx":{"type":"number"},"prevDayPx":{"type":"number"},"change24h":{"type":"number"},"fundingHourly":{"type":"number"},"openInterestUsd":{"type":"number"},"dayVolumeUsd":{"type":"number"},"maxLeverage":{"type":"number"},"impactBid":{"type":["number","null"]},"impactAsk":{"type":["number","null"]},"delisted":{"type":"boolean"}}},"Product":{"type":"object","properties":{"slug":{"type":"string"},"ticker":{"type":"string"},"name":{"type":"string"},"tagline":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"basket":{"$ref":"#/components/schemas/BasketConfig"},"methodology":{"type":"array","items":{"type":"string"}},"status":{"type":"string","const":"preview"}}},"MarketSummary":{"type":"object","properties":{"slug":{"type":"string"},"ticker":{"type":"string"},"name":{"type":"string"},"tagline":{"type":"string"},"category":{"type":"string"},"leverage":{"type":"number"},"effectiveLeverage":{"type":"number"},"nav":{"type":"number"},"change24h":{"type":"number","description":"Change since the last UTC daily close"},"return30d":{"type":["number","null"]},"return90d":{"type":["number","null"]},"volatilityAnnual":{"type":["number","null"]},"fundingAnnual":{"type":["number","null"]},"riskLabel":{"type":"string","enum":["Low","Moderate","Elevated","High"]},"legs":{"type":"array","items":{"$ref":"#/components/schemas/BasketLeg"}},"sparkline":{"type":"array","items":{"type":"number"}},"stale":{"type":"boolean"}}},"NavSnapshot":{"type":"object","properties":{"slug":{"type":"string"},"nav":{"type":"string","description":"Decimal string, 6 dp"},"navNumber":{"type":"number"},"previousCloseNav":{"type":"number"},"change24h":{"type":"number"},"asOf":{"type":"integer"},"priceAsOf":{"type":"integer"},"provenance":{"$ref":"#/components/schemas/Provenance"},"stale":{"type":"boolean"}}},"CompositionRow":{"type":"object","properties":{"assetId":{"type":"string"},"symbol":{"type":"string"},"name":{"type":"string"},"assetClass":{"type":"string"},"direction":{"type":"string"},"targetWeight":{"type":"number"},"exposure":{"type":"number","description":"Signed exposure per unit NAV (weight x leverage x direction)"},"price":{"type":"number"},"change24h":{"type":"number"},"fundingHourly":{"type":"number"}}},"RiskMetrics":{"type":"object","properties":{"historyDays":{"type":"integer"},"sufficientHistory":{"type":"boolean"},"volatilityAnnual":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]},"var95Daily":{"type":["number","null"]},"worstDay":{"type":["number","null"]},"bestDay":{"type":["number","null"]},"returnToVol":{"type":["number","null"]},"grossExposure":{"type":"number"},"netExposure":{"type":"number"},"longExposure":{"type":"number"},"shortExposure":{"type":"number"},"effectiveLeverage":{"type":"number"},"concentrationHHI":{"type":"number"},"topWeight":{"type":"number"},"effectiveAssets":{"type":"number"},"fundingAnnual":{"type":["number","null"]},"liquidityCapacityUsd":{"type":["number","null"]},"priceAgeSeconds":{"type":"number"},"pricingConfidence":{"type":"number"},"riskScore":{"type":"integer"},"riskLabel":{"type":"string","enum":["Low","Moderate","Elevated","High"]}}},"StressResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"basketMove":{"type":"number"}}},"History":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"integer"},"nav":{"type":"number"},"reference":{"type":"number"},"drawdown":{"type":"number"}}}},"startTime":{"type":"integer"},"endTime":{"type":"integer"},"totalReturn":{"type":"number"},"annualizedReturn":{"type":["number","null"]},"volatilityDecay":{"type":"number"},"rebalances":{"type":"integer"},"fundingPaid":{"type":"number"},"feesPaid":{"type":"number"},"executionCosts":{"type":"number"},"liquidated":{"type":"boolean"},"rebalanceEvents":{"type":"array","items":{"type":"object"}},"assumptions":{"type":"array","items":{"type":"string"}}}},"RebalancePlan":{"type":"object","properties":{"equityUsd":{"type":"number"},"currentLeverage":{"type":"number"},"targetLeverage":{"type":"number"},"maxDrift":{"type":"number"},"legs":{"type":"array","items":{"type":"object"}},"turnoverUsd":{"type":"number"},"estCostUsd":{"type":"number"},"estCostBps":{"type":"number"},"needed":{"type":"boolean"}}},"Quote":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["mint","redeem"]},"slug":{"type":"string"},"principal":{"type":"string"},"amountUsd":{"type":"string"},"grossUsd":{"type":"string"},"shares":{"type":"string"},"nav":{"type":"string"},"fee":{"type":"string"},"slippage":{"type":"string"},"feeBps":{"type":"number"},"slippageBps":{"type":"number"},"priceAsOf":{"type":"integer"},"iat":{"type":"integer"},"exp":{"type":"integer"},"token":{"type":"string","description":"HMAC-signed quote token"},"allocation":{"type":"array","items":{"type":"object"}}}},"ExecuteRequest":{"type":"object","required":["quote","idempotencyKey"],"properties":{"quote":{"type":"string"},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}},"PreviewTransaction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["mint","redeem","faucet"]},"slug":{"type":["string","null"]},"amountUsd":{"type":"string"},"shares":{"type":"string"},"nav":{"type":"string"},"fee":{"type":"string"},"slippage":{"type":"string"},"createdAt":{"type":"integer"},"status":{"type":"string","const":"settled-preview"}}},"ExecutionResult":{"type":"object","properties":{"transaction":{"$ref":"#/components/schemas/PreviewTransaction"},"replayed":{"type":"boolean"}}},"SavedBasket":{"type":"object","properties":{"id":{"type":"string"},"owner":{"type":"string"},"config":{"$ref":"#/components/schemas/BasketConfig"},"createdAt":{"type":"integer"}}},"Session":{"type":"object","properties":{"authenticated":{"type":"boolean"},"kind":{"type":"string","enum":["privy","wallet"]},"address":{"type":["string","null"]},"expiresAt":{"type":"integer"}}},"WalletBalances":{"type":"object","properties":{"address":{"type":"string"},"balances":{"type":"array","items":{"type":"object","properties":{"chainId":{"type":"integer"},"chain":{"type":"string"},"symbol":{"type":"string"},"token":{"type":"string"},"balance":{"type":"string"},"provenance":{"type":"string","const":"onchain"}}}},"hypercore":{"type":["object","null"]},"errors":{"type":"array","items":{"type":"string"}}}},"ProtocolStats":{"type":"object","properties":{"products":{"type":"integer"},"supportedAssets":{"type":"integer"},"availableAssets":{"type":"integer"},"underlyingVolume24hUsd":{"type":"number","description":"Underlying venue volume (not ELYVX volume)"},"underlyingOpenInterestUsd":{"type":"number","description":"Underlying venue open interest (not ELYVX TVL)"},"preview":{"type":"object"},"tvlUsd":{"type":"null","description":"No vaults deployed in the preview"},"snapshotAt":{"type":"integer"},"stale":{"type":"boolean"}}},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"]},"version":{"type":"string"}}}}}}