strike_sdk/lib.rs
1//! # Strike SDK
2//!
3//! Rust SDK for [Strike](https://github.com/ayazabbas/strike) prediction markets
4//! on BNB Chain.
5//!
6//! Strike is a fully on-chain prediction market protocol using Frequent Batch
7//! Auctions (FBA) for fair price discovery. Traders buy and sell binary outcome
8//! tokens (YES/NO) on whether an asset's price will be above or below a strike
9//! price at expiry.
10//!
11//! ## Quick Start
12//!
13//! ```rust,no_run
14//! use strike_sdk::prelude::*;
15//!
16//! # async fn example() -> strike_sdk::error::Result<()> {
17//! // Read-only client
18//! let client = StrikeClient::new(StrikeConfig::bsc_testnet()).build()?;
19//! let markets = client.indexer().get_markets().await?;
20//!
21//! // Trading client (with wallet)
22//! let client = StrikeClient::new(StrikeConfig::bsc_testnet())
23//! .with_private_key("0x...")
24//! .build()?;
25//!
26//! // Approve USDT spending
27//! client.vault().approve_usdt().await?;
28//!
29//! // Place orders
30//! let orders = client.orders().place(1, &[
31//! OrderParam::bid(50, 1000),
32//! OrderParam::ask(60, 1000),
33//! ]).await?;
34//! # Ok(())
35//! # }
36//! ```
37//!
38//! ## Key Concepts
39//!
40//! - **LOT_SIZE** = 1e16 wei ($0.01 per lot)
41//! - **Ticks** are 1–99, representing $0.01–$0.99 probability
42//! - **4-sided orderbook**: Bid, Ask, SellYes, SellNo
43//! - **Batch auctions**: Orders are collected and cleared in batches
44//! - All fills pay the clearing tick, not the limit tick
45//!
46//! ## Features
47//!
48//! - `nonce-manager` (default) — shared nonce management via [`NonceSender`](nonce::NonceSender)
49
50pub mod chain;
51pub mod client;
52pub mod config;
53#[allow(clippy::too_many_arguments)]
54pub mod contracts;
55pub mod error;
56pub mod events;
57pub mod indexer;
58pub mod nonce;
59pub mod types;
60
61/// Convenient re-exports for common usage.
62pub mod prelude {
63 pub use crate::client::StrikeClient;
64 pub use crate::config::{ContractAddresses, StrikeConfig};
65 pub use crate::error::{Result, StrikeError};
66 pub use crate::types::*;
67}