# Ostium Rust SDK Documentation
Welcome to the comprehensive documentation for the Ostium Rust SDK. This SDK provides a modern, type-safe interface for interacting with the Ostium trading platform on Arbitrum.
[](https://crates.io/crates/ostium-rust-sdk)
[](https://docs.rs/ostium-rust-sdk)
[](https://opensource.org/licenses/MIT)
## Quick Navigation
### 🚀 Getting Started
New to the Ostium SDK? Start here:
- **[Installation](getting-started/installation.md)** - Add the SDK to your project
- **[Quick Start](getting-started/quickstart.md)** - 5-minute tutorial
- **[Authentication](getting-started/authentication.md)** - Set up wallets and keys
- **[Your First Trade](getting-started/first-trade.md)** - Complete trading tutorial
### 📖 Guides
Task-oriented guides for common use cases:
- **[Client Setup](guides/client-setup.md)** - Configure the SDK client
- **[Trading Operations](guides/trading-operations.md)** - Open, close, and manage positions
- **[Market Data](guides/market-data.md)** - Fetch prices and market information
- **[Account Management](guides/account-management.md)** - Check balances and positions
- **[Error Handling](guides/error-handling.md)** - Handle errors gracefully
- **[Testing](guides/testing.md)** - Test your integration
### 📚 API Reference
Complete API documentation:
- **[OstiumClient](api-reference/client.md)** - Main client interface
- **[Trading API](api-reference/trading.md)** - Trading operations
- **[Market Data API](api-reference/market-data.md)** - Price and market data
- **[Account API](api-reference/account.md)** - Account and balance queries
- **[Types](api-reference/types.md)** - Data structures and enums
- **[Errors](api-reference/errors.md)** - Error types and handling
- **[Contracts](api-reference/contracts.md)** - Smart contract interfaces
### 💡 Examples
Real-world code examples:
- **[Basic Usage](examples/basic-usage.md)** - Simple SDK usage patterns
- **[Advanced Trading](examples/advanced-trading.md)** - Complex trading scenarios
- **[Portfolio Management](examples/portfolio-management.md)** - Manage multiple positions
- **[Integration Patterns](examples/integration-patterns.md)** - Common implementation patterns
### 🏗️ Architecture
Technical deep-dive:
- **[Overview](architecture/overview.md)** - System architecture
- **[Design Decisions](architecture/design-decisions.md)** - Why we built it this way
- **[Smart Contracts](architecture/contracts.md)** - Contract details
- **[Security](architecture/security.md)** - Security considerations
### 🔧 Troubleshooting
Problem-solving guides:
- **[Common Issues](troubleshooting/common-issues.md)** - FAQ and solutions
- **[Network Issues](troubleshooting/network-issues.md)** - Connectivity problems
- **[Transaction Errors](troubleshooting/transaction-errors.md)** - Failed transactions
- **[Debugging](troubleshooting/debugging.md)** - Debug your integration
### 🤝 Contributing
Help improve the SDK:
- **[Development Setup](contributing/development.md)** - Get started contributing
- **[Coding Standards](contributing/coding-standards.md)** - Code style guidelines
- **[Testing Guidelines](contributing/testing.md)** - How to test changes
- **[Release Process](contributing/release-process.md)** - How releases work
## What is Ostium?
Ostium is a decentralized perpetual trading platform built on Arbitrum. It enables traders to:
- **Trade Perpetuals**: Long or short positions with leverage up to 100x
- **Access Multiple Assets**: Trade crypto pairs like BTC/USD, ETH/USD, and more
- **Use Advanced Features**: Take profit, stop loss, and risk management tools
- **Benefit from Low Fees**: Competitive trading fees on Arbitrum
## SDK Features
The Ostium Rust SDK provides:
- 🦀 **Pure Rust Implementation** - Type-safe and performant
- ⚡ **Async/Await Support** - Built on Tokio for efficient operations
- 🔐 **Secure Wallet Integration** - Safe key management and signing
- 🌐 **Multi-Network Support** - Mainnet and testnet compatibility
- 📊 **Complete Trading API** - Full perpetual trading functionality
- 💰 **Precise Math** - Decimal arithmetic for financial calculations
- 🛡️ **Comprehensive Error Handling** - Detailed error types and recovery
- 📚 **Rich Documentation** - Examples, guides, and API reference
## Quick Example
```rust
use ostium_rust_sdk::{OstiumClient, Network, OpenPositionParams, PositionSide};
use rust_decimal_macros::dec;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a client
let client = OstiumClient::builder(Network::Testnet)
.with_private_key("your_private_key")?
.build()
.await?;
// Check balance
let balance = client.get_balance(None).await?;
println!("USDC Balance: {}", balance.total);
// Open a position
let params = OpenPositionParams {
symbol: "BTC/USD".to_string(),
side: PositionSide::Long,
size: dec!(0.01),
leverage: dec!(5.0),
take_profit: Some(dec!(55000)),
stop_loss: Some(dec!(45000)),
slippage_tolerance: dec!(0.01),
};
let tx_hash = client.open_position(params).await?;
println!("Position opened: {}", tx_hash);
Ok(())
}
```
## Need Help?
- 📖 **Documentation**: You're reading it! Check the guides and API reference
- 🐛 **Issues**: Report bugs on [GitHub Issues](https://github.com/ranger-finance/ostium-rust-sdk/issues)
- 💬 **Discussions**: Ask questions in [GitHub Discussions](https://github.com/ranger-finance/ostium-rust-sdk/discussions)
- 📝 **Examples**: See the [examples directory](../examples/) for working code
## What's Next?
1. **[Install the SDK](getting-started/installation.md)** - Add it to your project
2. **[Follow the Quick Start](getting-started/quickstart.md)** - Build your first app
3. **[Read the Guides](guides/)** - Learn best practices
4. **[Explore Examples](examples/)** - See real implementations
---
**Ready to start building?** Jump to the [Installation Guide](getting-started/installation.md) to get started!