Expand description
the0 SDK for Rust trading bots
This crate provides utilities for building trading bots on the0 platform.
§Example
use the0_sdk::input;
use the0_sdk::state;
fn main() {
let (bot_id, config) = input::parse().expect("Failed to parse bot config");
println!("Bot {} starting with config: {:?}", bot_id, config);
// Load persistent state
let trade_count: i32 = state::get_or("trade_count", 0);
// Your trading logic here
// Save state
state::set("trade_count", &(trade_count + 1)).ok();
input::success("Bot executed successfully");
}Modules§
- input
- Input parsing and output formatting utilities
- query
- the0 Query Module - Express-like handler interface for bot queries.
- state
- the0 State Module
Enums§
- Parse
Error - Errors that can occur when parsing bot configuration