A Rust SDK for interacting with DeepBook - a decentralized exchange (DEX) protocol on the Sui network.
- Account management for orders and balances
- DEX operations (place/cancel orders, check order status)
- Liquidity pool interactions
- Admin operations for DeepBook
- Level2 orderbook data queries
- Flash loan capabilities
- Balance management utilities
Add this to your Cargo.toml:
[dependencies]
sui-deepbookv3 = { git = "https://github.com/hoh-zone/sui-deepbookv3" }Here are some example use cases:
use sui_deepbookv3::client::Client;
#[tokio::main]
async fn main() {
let client = Client::new().await;
let orders = client.get_account_open_orders().await;
println!("Open orders: {:?}", orders);
}use sui_deepbookv3::client::Client;
#[tokio::main]
async fn main() {
let client = Client::new().await;
let level2_data = client.get_level2_book_status(0, 10).await;
println!("Order book depth: {:?}", level2_data);
}Check the examples/ directory for more detailed usage:
account_open_orders.rs- Query account's open ordersaccount_order_map.rs- Map orders to accountbalance.rs- Check account balancesget_level2_range.rs- Get order book depth
Run the test suite:
cargo test- Fork the repository
- Create your feature branch (
git checkout -b feature/awesome-feature) - Commit your changes (
git commit -am 'Add awesome feature') - Push to the branch (
git push origin feature/awesome-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.