How thaihoandev/crypto-evaluator-api works
Crypto Trade Evaluator is an ASP.NET API for managing trade setups and producing market-analysis, risk, scoring, and probability estimates. The principal workflow is: a client creates a setup, requests its evaluation, and retrieves or closes it; a separate analysis endpoint builds Long/Short proposals from market candles. Prediction outcomes can be backtested, while real-time ticker endpoints expose Binance stream data. The sampled handlers establish several dispatches and calculations; broader trade-command wiring is represented only where the README documents the capability. PostgreSQL and Redis are documented stores, but their runtime wiring is not fully sampled.
Main entry points: TradesController.cs Trade endpoints · AnalyzeMarketQuery.cs Analyze market · BinanceMarketDataProvider.cs Market provider · BinanceTickerWebSocketService.cs Ticker WebSocket
Components 22
HTTP API
- Trade endpoints
src/CryptoEvaluator.API/Controllers/TradesController.cs - Ticker endpoints
src/CryptoEvaluator.API/Controllers/MarketStreamController.cs
Trade Analysis
- Manage setups
src/CryptoEvaluator.Application/Trades/Commands/CreateTrade/CreateTradeCommand.cs - Evaluate trade
src/CryptoEvaluator.Application/Evaluations/Commands/EvaluateTrade/EvaluateTradeCommand.cs - Analyze market
src/CryptoEvaluator.Application/MarketAnalysis/Queries/AnalyzeMarket/AnalyzeMarketQuery.cs - Indicators
src/CryptoEvaluator.Application/Indicators/IndicatorEngine.cs - Risk calculation
src/CryptoEvaluator.Application/Risk/RiskCalculator.cs - Setup scoring
src/CryptoEvaluator.Application/Scoring/TradeScoreCalculator.cs - Trade warnings
src/CryptoEvaluator.Application/Warnings/WarningEngine.cs - Trade prediction
src/CryptoEvaluator.Application/Prediction/MonteCarloGbmPredictor.cs - Read prediction
src/CryptoEvaluator.Application/Predictions/Queries/GetPrediction/GetPredictionQuery.cs - Prediction backtests
src/CryptoEvaluator.Application/Predictions/Queries/GetPredictionBacktest/GetPredictionBacktestQuery.cs - Walk-forward test
src/CryptoEvaluator.Application/Predictions/WalkForwardBacktestEngine.cs
Market Data
- Market provider
src/CryptoEvaluator.Infrastructure/MarketData/Binance/BinanceMarketDataProvider.cs - Ticker WebSocket
src/CryptoEvaluator.Infrastructure/MarketData/Binance/BinanceTickerWebSocketService.cs - Local ticker store
src/CryptoEvaluator.Infrastructure/MarketData/Binance/RealtimeTickerStore.cs
Persistence
- Trade repositories
src/CryptoEvaluator.Infrastructure/Persistence/Repositories/TradeRepository.cs - Prediction repository
src/CryptoEvaluator.Infrastructure/Persistence/Repositories/TradePredictionRepository.cs - PostgreSQL
src/CryptoEvaluator.Infrastructure/Persistence/AppDbContext.cs
Other components
- API client
- Binance Futures
- Redis cache
Connections 26
- API client → Trade endpoints: requests
- API client → Ticker endpoints: requests
- Trade endpoints → Manage setups: dispatches commands
- Trade endpoints → Evaluate trade: dispatches command
- Trade endpoints → Analyze market: dispatches query
- Trade endpoints → Read prediction: dispatches query
- Trade endpoints → Prediction backtests: dispatches query
- Trade endpoints → Walk-forward test: runs backtest
- Trade endpoints → Market provider: requests candles
- Analyze market → Market provider: fetches candles
- Analyze market → Indicators: calculates indicators
- Analyze market → Risk calculation: calculates risk
- Analyze market → Setup scoring: scores setups
- Analyze market → Trade prediction: predicts outcomes
- Analyze market → Trade warnings: generates warnings
- Read prediction → Prediction repository: reads prediction
- Prediction backtests → Prediction repository: loads outcomes
- Walk-forward test → Market provider: requests candles
- Market provider → Binance Futures: requests market data
- Ticker WebSocket → Binance Futures: receives ticker stream
- Ticker WebSocket → Local ticker store: updates tickers
- Ticker WebSocket → Redis cache: writes ticker cache
- Ticker endpoints → Local ticker store: reads ticker
- Ticker endpoints → Redis cache: fallback reads
- Trade repositories → PostgreSQL: reads and writes
- Prediction repository → PostgreSQL: reads and writes