Skip to main content

Crate strike_sdk

Crate strike_sdk 

Source
Expand description

§Strike SDK

Rust SDK for Strike prediction markets on BNB Chain.

Strike is a fully on-chain prediction market protocol using Frequent Batch Auctions (FBA) for fair price discovery. Traders buy and sell binary outcome tokens (YES/NO) on whether an asset’s price will be above or below a strike price at expiry.

§Quick Start

use strike_sdk::prelude::*;

// Read-only client
let client = StrikeClient::new(StrikeConfig::bsc_testnet()).build()?;
let markets = client.indexer().get_markets().await?;

// Trading client (with wallet)
let client = StrikeClient::new(StrikeConfig::bsc_testnet())
    .with_private_key("0x...")
    .build()?;

// Approve USDT spending
client.vault().approve_usdt().await?;

// Place orders
let orders = client.orders().place(1, &[
    OrderParam::bid(50, 1000),
    OrderParam::ask(60, 1000),
]).await?;

§Key Concepts

  • LOT_SIZE = 1e16 wei ($0.01 per lot)
  • Ticks are 1–99, representing $0.01–$0.99 probability
  • 4-sided orderbook: Bid, Ask, SellYes, SellNo
  • Batch auctions: Orders are collected and cleared in batches
  • All fills pay the clearing tick, not the limit tick

§Features

  • nonce-manager (default) — shared nonce management via NonceSender

Modules§

chain
On-chain contract interaction clients.
client
StrikeClient — the main entry point for the SDK.
config
Chain configuration and contract addresses.
contracts
Alloy contract bindings generated from ABI JSON files.
error
Error types for the Strike SDK.
events
Event subscription and historical scanning.
indexer
REST client for the Strike indexer API.
nonce
Shared nonce manager for sequential transaction sends.
prelude
Convenient re-exports for common usage.
types
Core SDK types: Side, OrderType, OrderParam, and event types.