{"name":"QuantGuard Pro API","version":"2.0.0-secure","description":"Secure Quantitative Trading System Backend","security":{"authentication":"JWT (HMAC-SHA256)","authorization":"RBAC with 5 roles","mfa":"TOTP-based MFA supported","killSwitch":"4-level hierarchy with auto-actions","audit":"Tamper-proof hash-chain logging","rateLimiting":"Multi-layer with threat detection","circuitBreaker":"Exchange API fault tolerance"},"documentation":{"auth":{"base":"/api/auth","endpoints":[{"method":"POST","path":"/api/auth/login","description":"Login with username/password","auth":"none"},{"method":"POST","path":"/api/auth/mfa/verify","description":"Verify MFA code","auth":"temp token"},{"method":"POST","path":"/api/auth/register","description":"Register new user (SuperAdmin)","auth":"SuperAdmin"},{"method":"POST","path":"/api/auth/refresh","description":"Refresh access token","auth":"refresh token"},{"method":"POST","path":"/api/auth/logout","description":"Logout","auth":"required"},{"method":"POST","path":"/api/auth/logout-all","description":"Logout all sessions","auth":"required"},{"method":"GET","path":"/api/auth/me","description":"Get current user profile","auth":"required"},{"method":"GET","path":"/api/auth/sessions","description":"Get active sessions","auth":"required"},{"method":"GET","path":"/api/auth/users","description":"List all users (SuperAdmin)","auth":"SuperAdmin"}]},"market":{"base":"/api/market","auth":"required (market:read)","endpoints":[{"method":"GET","path":"/api/market/ticker","description":"Get all tickers"},{"method":"GET","path":"/api/market/ticker/:symbol","description":"Get single ticker"},{"method":"GET","path":"/api/market/orderbook/:symbol","description":"Get order book"},{"method":"GET","path":"/api/market/klines/:symbol","description":"Get K-line data"},{"method":"GET","path":"/api/market/funding-rate","description":"Get funding rates"},{"method":"GET","path":"/api/market/search","description":"Search symbols"}]},"trading":{"base":"/api/trading","auth":"required (various trade:* permissions)","endpoints":[{"method":"GET","path":"/api/trading/balance","description":"Account balance","perm":"trade:read"},{"method":"GET","path":"/api/trading/orders","description":"Open orders","perm":"trade:read"},{"method":"POST","path":"/api/trading/order","description":"Create order","perm":"trade:create"},{"method":"DELETE","path":"/api/trading/order/:id","description":"Cancel order","perm":"trade:delete"},{"method":"GET","path":"/api/trading/positions","description":"Get positions","perm":"trade:read"},{"method":"POST","path":"/api/trading/kill-switch","description":"Control kill switch","perm":"killswitch:trigger"},{"method":"GET","path":"/api/trading/kill-switch","description":"Kill switch status","perm":"killswitch:read"},{"method":"GET","path":"/api/trading/kill-switch/history","description":"Kill switch history","perm":"killswitch:read"},{"method":"GET","path":"/api/trading/status","description":"Trading status","perm":"trade:read"}]},"risk":{"base":"/api/risk","auth":"required (risk:read or risk:manage)","endpoints":[{"method":"GET","path":"/api/risk/var","description":"VaR calculation","perm":"risk:read"},{"method":"POST","path":"/api/risk/var/portfolio","description":"Portfolio VaR","perm":"risk:manage"},{"method":"GET","path":"/api/risk/cvar","description":"CVaR calculation","perm":"risk:read"},{"method":"GET","path":"/api/risk/stress-test","description":"Stress test","perm":"risk:read"},{"method":"GET","path":"/api/risk/margins","description":"Margin info","perm":"risk:read"},{"method":"GET","path":"/api/risk/limits","description":"Risk limits","perm":"risk:read"},{"method":"GET","path":"/api/risk/snapshot","description":"Risk snapshot","perm":"risk:read"},{"method":"GET","path":"/api/risk/dashboard","description":"Risk dashboard","perm":"risk:read"}]},"agents":{"base":"/api/agents","auth":"required (agent:read or agent:vote)","endpoints":[{"method":"GET","path":"/api/agents/status","description":"Agent status","perm":"agent:read"},{"method":"GET","path":"/api/agents/decisions","description":"Decision history","perm":"agent:read"},{"method":"GET","path":"/api/agents/vote","description":"Current vote","perm":"agent:read"},{"method":"POST","path":"/api/agents/vote","description":"Submit vote","perm":"agent:vote"},{"method":"GET","path":"/api/agents/config","description":"Agent config","perm":"agent:read"}]},"backtest":{"base":"/api/backtest","auth":"required (backtest:run or backtest:read)","endpoints":[{"method":"POST","path":"/api/backtest/run","description":"Run backtest","perm":"backtest:run"},{"method":"GET","path":"/api/backtest/results","description":"Backtest results","perm":"backtest:read"},{"method":"GET","path":"/api/backtest/strategies","description":"Strategy list","perm":"backtest:read"},{"method":"POST","path":"/api/backtest/compare","description":"Compare backtests","perm":"backtest:read"}]},"wallet":{"base":"/api/wallet","auth":"required (wallet:read or wallet:transfer)","endpoints":[{"method":"GET","path":"/api/wallet/layers","description":"Wallet layers","perm":"wallet:read"},{"method":"GET","path":"/api/wallet/layers/:id","description":"Layer details","perm":"wallet:read"},{"method":"GET","path":"/api/wallet/transfers","description":"Transfer history","perm":"wallet:read"},{"method":"POST","path":"/api/wallet/transfer","description":"Transfer funds","perm":"wallet:transfer"},{"method":"GET","path":"/api/wallet/summary","description":"Wallet summary","perm":"wallet:read"}]},"settings":{"base":"/api/settings","auth":"required (settings:read or settings:update)","endpoints":[{"method":"GET","path":"/api/settings/exchanges","description":"Exchange configs","perm":"settings:read"},{"method":"GET","path":"/api/settings/exchanges/:id","description":"Exchange detail","perm":"settings:read"},{"method":"PUT","path":"/api/settings/exchanges/:id","description":"Update exchange","perm":"settings:update"},{"method":"GET","path":"/api/settings/global","description":"Global settings","perm":"settings:read"},{"method":"PUT","path":"/api/settings/global","description":"Update global settings","perm":"settings:update"}]},"audit":{"base":"/api/audit","auth":"required (audit:read)","endpoints":[{"method":"GET","path":"/api/audit","description":"Query audit log","perm":"audit:read"},{"method":"GET","path":"/api/audit/stats","description":"Audit statistics","perm":"audit:read"},{"method":"GET","path":"/api/audit/verify","description":"Verify hash chain integrity","perm":"audit:read"},{"method":"GET","path":"/api/audit/export","description":"Export audit log","perm":"audit:read"}]},"system":{"base":"/api/system","auth":"required (SuperAdmin)","endpoints":[{"method":"GET","path":"/api/system/circuit-breakers","description":"Circuit breaker status","perm":"system:admin"},{"method":"GET","path":"/api/system/rate-limits","description":"Rate limit status","perm":"system:admin"},{"method":"GET","path":"/api/system/threats","description":"Threat report","perm":"system:admin"},{"method":"POST","path":"/api/system/unblock-ip","description":"Unblock an IP","perm":"system:admin"}]}},"websocket":{"endpoint":"ws://localhost:8080/ws","description":"Real-time market data stream (authenticated)","channels":["ticker","orderbook","trades"]}}