इस प्रोजेक्ट के बारे में

AI Multi-Agent Cryptocurrency Futures Platform Binance USD-M Futures और OKX perpetual swaps के लिए एक उत्पादन-उन्मुख क्रिप्टोकरेंसी futures शोध और निष्पादन प्रणाली है। यह pnpm workspace के रूप में संरचित है, जिसमें Next.js वेब एप्लिकेशन, Node.js API, PostgreSQL (Prisma के माध्यम से), Redis और BullMQ शामिल हैं, और Docker Compose सेटअप के साथ लाया गया है। मूल सिद्धांत यह है कि AI केवल सलाहकार है: एजेंट सीधे exchange adapter को कॉल नहीं कर सकते, और स्वचालित ऑर्डर Decision/Judge पाइपलाइन और एक determinisric Risk Engine से होकर Trading Engine द्वारा निष्पादित होने से पहले प्रवाहित होने चाहिए। सुरक्षा और खाते। बहु-यूजर प्रमाणीकरण, Redis-आधारित sessions, CSRF सुरक्षा, TOTP दो-कारक प्रमाणीकरण, audit logs, Argon2id पासवर्ड hashing और AES-256-GCM एन्क्रिप्टेड provider क्रेडेंसियल्स। पासवर्ड रीसेट एक email transport (SMTP या webhook URL plus secret) के माध्यम से कॉन्फ़िगर होता है; रीसेट लिंक 15 मिनट बाद समाप्त हो जाते हैं, एक-उपयोग वाले होते हैं, कभी भी plaintext में संग्रहीत या लॉग नहीं किए जाते, और सफल पासवर्ड परिवर्तन खाते के सभी मौजूदा sessions को रद्द कर देता है। Exchange integrations. Binance Futures और OKX adapters public market data, private account state, positions, open orders, order history, order placement, cancellation, और protective-order amendment को कवर करते हैं जहां exchange समर्थन करता है। Market और external data. Realtime market streams, normalized candles, indicators, gap detection, backfill, Redis snapshots, और /market पर Socket.IO namespace। एक अलग ingestion layer news, exchange announcements, incidents, sentiment, Reddit और macro calendar संभालती है, ingestion queues, deduplication और importance scoring के साथ, जो /external-data realtime events के माध्यम से प्रकाशित होती है। AI infrastructure. Bounded tool calling, agent lifecycle management, Decision Agent, Judge controls, BullMQ pipeline scheduling, replay, cancellation, health reporting और metrics के साथ provider-independent AI layer। Risk, portfolio और research. Deterministic risk assessment, portfolio exposure controls, strategy allocation और rebalancing, performance और reflection loops, shadow/canary self-learning, backtesting, validation, benchmarking, simulation, factor discovery और quantitative recommendations। Execution. Exchange-backed DEMO/LIVE trading kill switch, idempotent client order IDs, state synchronization, TP/SL protection और Position Manager के साथ, जिसे /live-trading realtime dashboard namespace के माध्यम से सतही बनाया गया है। Adaptive TP/SL और Position Manager. हमेशा environment percentages से take-profit और stop-loss levels निकालने के बजाय, deterministic Trade Plan Engine ATR, support/resistance, EMA20/EMA50, ADX, efficiency ratio, breakout state, market structure, fees और configured risk/reward requirements का उपयोग करके conditions को TREND_UP, TREND_DOWN, RANGING, BREAKOUT या HIGH_VOLATILITY के रूप में वर्गीकृत करता है, और matching plan type उत्पन्न करता है: trend pullback, range-boundary entry और target, breakout/retest, या volatility-controlled। Engine खराब entry location, structurally excessive stops, और ऐसे targets को अस्वीकार करती है जिनकी net reward/risk policy से कम है; STOP_LOSS_PCT और RISK_REWARD_RATIO जैसे settings policy defaults और fallback रहते हैं जब ATR और structure data अनुपलब्ध हो। Entry के बाद, Position Manager exchange state को synchronizes कर सकता है और stop को break-even plus fee buffer तक ले जा सकता है, sufficient favorable movement के बाद ATR द्वारा trail कर सकता है, 1R पर एक partial profit ले सकता है, stagnant positions को explicit protective, manual, exchange या strategy-authorized close होने तक खुला रख सकता है, adapter के माध्यम से protective orders को amend या cancel/recreate कर सकता है, और position बंद होने के बाद orphan protection को clean कर सकता है। LIVE_POSITION_SYNC_INTERVAL_MS डिफ़ॉल्ट रूप से 30 सेकंड है; exchange order-history imports और Live Trading dashboard 20 सबसे हालिया orders तक सीमित हैं, जबकि positions और safety/protection checks को truncate नहीं किया जाता। Safety gates. TRADING_MODE=DEMO safe default है। Execution से पहले system GLOBAL_TRADING_ENABLED, LIVE_TRADING_ENABLED, verified connection state, production connection permission, recent authentication, risk approval TTL, exposure limits, leverage limits, cooldown और kill-switch state की जांच करता है। LIVE mode के लिए LIVE_TRADING_ENABLED=true आवश्यक है, और production exchange connections तब तक अक्षम रहती हैं जब तक स्पष्ट रूप से सक्षम न किया जाए। README dedicated demo/testnet credentials का उपयोग करने और व्यवहार को सत्यापित करते समय withdrawal-capable API keys का उपयोग नहीं करने की सलाह देता है। Setup और operations. Requirements में Node.js 22.13 या नयातर (pnpm 11 द्वारा आवश्यक), pnpm 11 या नयातर, और Docker Desktop with Docker Compose शामिल हैं। Local setup में .env.example को root, apps/api और apps/web locations में कॉपी करना, dependencies install करना, Postgres, Redis और Adminer को Compose से शुरू करना, Prisma client generate करना, migrations apply करना और dev servers चलाना शामिल है; पूरा stack docker compose up -d --build के साथ भी शुरू किया जा सकता है। Documented services में port 3000 पर web app, /api, /docs और /api/health के साथ port 3001 पर API, और 8080 पर Adminer शामिल हैं। Scripts में dev, build, lint, strict TypeScript typechecking, Vitest unit suites, API integration tests, end-to-end tests, formatting checks, और Prisma generate, migrate और studio शामिल हैं। ARCHITECTURE.md, API_CONTRACT.md, DATABASE.md, DIRECTORY_STRUCTURE.md, ROADMAP.md, PROJECT_CONTEXT.md, DEFINITION_OF_DONE.md और PROJECT_RULES.md में additional documentation referenced है। Known boundaries stated by the project. Paper/shadow records evaluation और self-learning का समर्थन करते हैं, लेकिन Live Trading के तुल्य कोई standalone paper-trading execution API नहीं है। Backtests, demo runs और model confidence production profitability की गारंटी नहीं देते, और promotion adequate samples और drawdown review के साथ होती है। Code updates तब तक running containers को प्रभावित नहीं करते जब तक API और web services को rebuild या restart नहीं किया जाता।