This project is C# integration with BTC Market V3 API. It has integration with Account , Market , Order , Trade and MarketFeed Api endpoints. Most of the endpoints are integrated and this code base can be further extended to implement your program based trading strategies. Logging support is included with Serilog.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Create an appsettings.json file in Root folder of the project by copying content of appsettings.TXT file.
- Add API Key and Private Key for your BTCMarket account.
- Run the unit tests and Integration tests.
- Run BTCTrader project to see the Feed of market emitted to console output.
- Extend to your trading strategy and Happy Trading.
The project uses .net core 3.1. SDK and that is pretty much what is required to get started.
.Net Core 3.1
Your favourite IDE for coding. (I use Visual Studio Community Edition)
You can run tests for this project using following options
dotnet test
using Testrunner in Visual Studio
There are two types of tests in Tests Folder. Xunit framework is used for writing these types of tests. (In future i plan to add BDD tests too)
- Integration tests
The integration tests work with real api endpoint and do api contract validation.
All integration test classes inherit from ServiceTestsBase which uses TradingSystem Fixture that initialize all the dependencies per TestClass this helps in reduced code for each integration test (avoiding repeated Arrange section), this makes writing integration test easier by following DRY principle.
Some integration tests need to be run in sequence rather than parallel. e.g CancelAllOrders and AddOrder test cannot run in parallel. Xunit test collections are used to control to execution of such tests.
- Unit tests
The unit tests work by mocking dependencies and are mostly to test basic logics in code.
- .Net Core 3.1 - The framework used
- XUnit - Testing Framework for Unit and Integration Tests
- Serilog - Logging Framework used throughout the project provides multi-color output on errors and warnings.
Happy to share the code base if someone is interested. Just ping.
- Arslan Qamar - https://www.linkedin.com/in/arslanqamar/
See also the list of contributors who participated in this project.
This project is licensed under the MIT License.
- BTCMarket sample C# code https://github.com/BTCMarkets/api-v3-client-dotnet
- Inspiration Earn Money ;)
- Have Fun Trade Responsibly