My implementation of "Build a Fintech Platform in Rust"
Fintech Platform
Three-Project Series: Build a Fintech Platform in Rust
- Project 1: Fundamentals and Accounting - Project 2: Core Algorithms and Data Structures - Project 3: A Shared Marketplace API
The Original Description
Future Finance Labs, a fintech scale-up company, wants to expand its customer base by offering a lightning-fast exchange platform for professional traders. As its star developer, you’ll use the Rust programming language to create a prototype of the exchange that will accommodate high-frequency trading and serve as the foundation for additional future financial products.You’ll build an interactive command line program that will constitute the core accounting structure for setting up accounts and manipulating data.
You’ll create a matching engine that enables traders to find the best trading partners and showcases the blazing-fast core of the exchange platform.
You’ll extend your Rust HTTP API by setting up a warp web service that will interact with an additional trading platform, by building a shared marketplace that will be a blueprint for additional Rust web services, small and large.
Notes
- My implementation is a much improved version of the project's requirements and starter code.
- My implementation has two CLI applications, where they only have one:
- I use the above-mentioned input validation in both CLI apps,
The Most Notable Crates Used
- warp, as web framework
- Tokio, as an asynchronous runtime
- reqwest, as an HTTP client
- Serde, for Rust data structures serialization and deserialization
- prettyenv_logger, for pretty logging
Running the Apps
From the project (workspace) directory:- Non-web:
cargo run -p fintech_cliorcargo run(default binary) - Web Service:
export RUSTLOG=<loglevel> && cargo run -p fintechwebservice,
where log level can be trace, debug, info, warn or error.
- For example: export RUSTLOG=trace && cargo run -p fintechweb_service
- Default logging level is info: cargo run -p fintechwebservice
- Web Client CLI:
cargo run -p fintechwebclient_cli
- With a provided web service URL: cargo run -p fintechwebclient_cli -- http://127.0.0.1:8080/
Use cargo run --release for the Release mode instead of the default Debug mode.
Potential Improvements and Additions
- Checking if a seller really has the amount they wish to sell;
- Removal of an account;
- Clearing everything: all accounts and entire transaction log.