Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/compolabs/orderbook-contract
https://github.com/compolabs/orderbook-contract
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/compolabs/orderbook-contract
- Owner: compolabs
- License: other
- Created: 2024-02-26T13:03:26.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-11-13T07:56:43.000Z (3 months ago)
- Last Synced: 2024-11-15T15:43:26.766Z (3 months ago)
- Language: Rust
- Size: 2.71 MB
- Stars: 40
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spark Orderbook Contract
The Spark Orderbook Contract is a decentralized order book implemented on the Fuel blockchain, designed to facilitate secure and transparent trading.
## Getting Started
The Orderbook framework consists of five components, which can be found in the root folder:
- **`spark-market`:** This Sway contract contains all the trading logic, including functionalities for opening, closing, and matching orders. It serves as the core of the trading operations, with corresponding tests included.
- **`spark-registry`:** This Sway contract allows for the registration of new markets, specifically for asset trading pairs. It acts as a registry that keeps track of all available markets, with tests included.
- **`spark-cli`:** Spark CLI tools for deploying and interacting with contracts. Detailed information is available in the README file within the subfolder.
- **`spark-market-sdk`:** A Rust library (SDK) for interacting with the SparkMarket contract. Additional details can be found in the README file within its subfolder.
- **`spark-registry-sdk`:** A Rust library (SDK) for interacting with the SparkRegistry contract. More information is available in the README file within its subfolder.## Running All Tests
To build the project and run all tests, execute the following command:
```
forc build --release & cargo test --release
```### Running Fuzz Tests:
To run fuzz tests, use the following command:
```
cargo test --release -- --ignored fuzz --test-threads=$(nproc || sysctl -n hw.ncpu)
```## Contribution
The liquidation mechanism, error codes, and all contract methods are open for community contributions. Your input is welcome to help improve and expand the Spark Orderbook Contract, making it a more robust and feature-rich platform.