Skip to content

M3 #32: SDK examples: Market data, trading, and market making#72

Merged
joaquinbejar merged 2 commits into
mainfrom
M3/issue-32-sdk-examples
Feb 2, 2026
Merged

M3 #32: SDK examples: Market data, trading, and market making#72
joaquinbejar merged 2 commits into
mainfrom
M3/issue-32-sdk-examples

Conversation

@joaquinbejar

Copy link
Copy Markdown
Owner

Summary

Adds comprehensive example applications demonstrating how to use the Rust and TypeScript SDKs for common use cases.

Changes

Rust SDK Examples (sdk/examples/)

File Description
market_data.rs Fetch and display market info, order book, trades
user_data.rs Fetch user orders, trade history, and balances
README.md Setup instructions and usage documentation

TypeScript SDK Examples (ts-sdk/examples/)

File Description
market-data.ts Fetch market data via HTTP client
place-order.ts Build place order transactions
stream-book.ts WebSocket order book streaming
simple-mm.ts Educational market maker example
README.md Setup instructions and usage documentation

Technical Decisions

  • Rust examples: Focus on HTTP client capabilities (market data, user data) since transaction building is not yet implemented in the SDK
  • TypeScript examples: Include WebSocket and transaction building examples to demonstrate full client capabilities
  • Market maker example: Clearly marked as educational only, not production-ready
  • Environment variables: All examples use env vars for configuration (API URL, market address, etc.)

Example Features

Each example includes:

  • Clear comments explaining each step
  • Error handling with informative messages
  • Configuration via environment variables
  • Devnet setup instructions in README

Testing

  • Rust examples compile (cargo clippy passes)
  • TypeScript SDK tests pass (60 tests)
  • Documentation complete

Checklist

  • Code follows project guidelines
  • Documentation included
  • No warnings from cargo clippy

Closes #32

Rust SDK examples (sdk/examples/):
- market_data.rs: Fetch markets, order book, and trades
- user_data.rs: Fetch user orders, trades, and balances
- README.md: Setup and usage documentation

TypeScript SDK examples (ts-sdk/examples/):
- market-data.ts: Fetch market data via HTTP client
- place-order.ts: Build place order transactions
- stream-book.ts: WebSocket order book streaming
- simple-mm.ts: Educational market maker example
- README.md: Setup and usage documentation

All examples include:
- Clear comments explaining each step
- Error handling
- Configuration via environment variables
- Devnet setup instructions

Closes #32
@joaquinbejar joaquinbejar added this to the M3: Client SDKs milestone Feb 2, 2026
@joaquinbejar joaquinbejar merged commit 2513d21 into main Feb 2, 2026
5 checks passed
@joaquinbejar joaquinbejar deleted the M3/issue-32-sdk-examples branch February 2, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK examples: Market data, trading, and market making

1 participant