2 unstable releases

0.2.0 Jun 12, 2023
0.1.0 Jun 4, 2023

#150 in Finance


Used in octopus-cli

Custom license

47KB
1K SLoC

Octopus

Trading CLI and engine for submitting and matching orders. 🐙

Built with Rust, consuming a Warp API and hosted on Railway.

demo

Installation

Cargo

Install the rust toolchain in order to have cargo installed by using this guide. Then install the cli crate with the following;

cargo install octopus-cli

You can also install the crate by cloning this repository and building it using Cargo. Run the following commands in your terminal:

Build

git clone https://github.com/richo225/octopus.git
cd octopus
cargo build --target octopus_cli --release

After a successful build, the binary will be available in the target/release directory.

Usage

To run the crate, use the following command in your terminal:

octopus-cli

If you would like to run the octopus server locally, execute the binary with:

RUST_LOG=trace cargo run --bin octopus-web

And then run the CLI, pointing to the local server:

cargo run --bin octopus-cli -- http://localhost:8080

Full documentation for the engine can be found at https://docs.rs/octopus-engine/0.1.0/octopus_engine/

Commands

deposit

Allows users to create an account or deposit funds into an existing account.

withdraw

Withdraw funds from a users account.

send

Send funds to another user's account.

submit_order

The submit_order command enables users to submit an order for processing by the engine. A receipt will be returned along with any matches.

orderbook

Retrieves the current order book.

account

Retrieves the user's account balance.

txlog

The txlog command retrieves the entire transaction log on the platform.

Testing

To run the tests for the crate, use the following command in your terminal:

cargo test

This will execute the test cases for both the cli and engine and provide you with the test results.

Contributing

Contributions are welcome! If you find a bug, have a feature request, or want to contribute code, please follow the guidelines in the contributing file.

License

This crate is licensed under the MIT License.

Dependencies

~0.3–1MB
~21K SLoC