TRadeTurk is an enterprise-grade Trading Simulation application built with .NET 10 and Clean Architecture. It allows users to simulate cryptocurrency trading using real-time data from the Binance API, manage virtual wallets, and execute buy/sell transactions with realistic conditions such as commission fees and price slippage.
- Real-time Market Data: Fetches live cryptocurrency prices using a background worker integrated with the Binance API.
- Proxy-Supported Binance Service: Reliable integration with external APIs using caching and proxy patterns.
- Live Price Updates: Uses SignalR for real-time streaming of price updates to connected clients (
/priceHub). - Virtual Wallets & Assets: Manage virtual portfolios, and securely deposit/withdraw simulated funds via virtual cards.
- Trading Engine: Execute Buy/Sell transactions with realistic slippage algorithms and commission calculations.
- CQRS Pattern: Implements Command Query Responsibility Segregation using MediatR for scalable and decoupled architecture.
The project strictly follows Clean Architecture principles to ensure separation of concerns, testability, and long-term maintainability.
- .NET 10 (C# 14)
- Entity Framework Core (SQL Server)
- MediatR (CQRS Pattern)
- FluentValidation (Pipeline Exception Handling & Request Validation)
- SignalR (WebSockets for real-time price feeds)
- AutoMapper (Object-to-object mapping for DTOs)
- Swagger/OpenAPI (API Documentation)
- Background Services (
IHostedServicefor scheduled background jobs likeBinanceDataWorker)
TRadeTurk.Domain: Core domain entities (Asset,Wallet,Transaction,Card), enums (TransactionStatus), trading strategies, and repository interfaces.TRadeTurk.Application: Business logic, CQRS Handlers (MediatR), Validators (FluentValidation), and Mappers.TRadeTurk.Infrastructure: Database context (ApplicationDbContext), Entity Framework Core migrations, generic repositories, Unit of Work, Binance API proxy service, and Background Jobs.TRadeTurk.WebAPI: ASP.NET Core API controllers, Exception Handling Middleware, SignalR Hubs (PriceHub), and Dependency Injection setup.
- .NET 10.0 SDK or later
- SQL Server (LocalDB, Developer Edition, or Docker container)
- Supported IDE (Visual Studio 2022, Rider, or VS Code)
-
Clone the repository:
git clone https://github.com/hasandogan0/TradeTurk.git cd TRadeTurk -
Configure the Database: Update the
ConnectionStrings:DefaultConnectioninsrc/TRadeTurk.WebAPI/appsettings.json(orappsettings.Development.json) to point to your local SQL Server instance. -
Apply Database Migrations: Using the .NET CLI, run the following command to update your database schema:
dotnet ef database update --project src/TRadeTurk.Infrastructure --startup-project src/TRadeTurk.WebAPI
-
Run the Application:
dotnet run --project src/TRadeTurk.WebAPI
-
Access the API Documentation: Once the application is running, open your browser and navigate to
https://localhost:<port>/swaggerto view and test the API endpoints.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the terms of the license provided in the LICENSE file.