Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Proof-labs/trading-sdk/llms.txt

Use this file to discover all available pages before exploring further.

The Proof Trading SDK gives developers everything needed to interact with the Proof Exchange: Ed25519 key generation, MessagePack wire encoding, timestamp-nonce allocation, and HTTP/WebSocket submission to both the public gateway and CometBFT RPC. Whether you’re building a trading bot, a market maker, or an analytics tool, the SDK handles the low-level protocol so you can focus on strategy.

Quickstart

Generate a keypair, fund an account on devnet, and place your first order in under five minutes.

Installation

Install the TypeScript, Python, or Rust SDK and connect to the Proof devnet.

ExchangeClient API

Full reference for every method on the ExchangeClient: submit, query, and subscribe.

Actions Reference

All 20+ exchange action types — PlaceOrder, CancelOrder, MarketOrder, and more.

What’s in the SDK

Key Management

Ed25519 keypair generation, address derivation, and signing with chain-ID binding.

Trading Guide

Place limit orders, market orders, cancel-replace, and atomic basket orders.

Account & Queries

Query balances, positions, orderbooks, tickers, and trade history.

Real-Time Events

Subscribe to live exchange events over WebSocket using the block subscription API.

Agent Wallets

Delegate a hot wallet to trade on behalf of a cold-stored owner account.

Paper Trading

Join the paper-trading competition with virtual funds on the real matching engine.

Supported Languages

TypeScript

@proof/trading-sdk — the primary SDK, published to npm.

Python

proof-trading-sdk — PyO3 bindings over the shared Rust core.

Rust

proof-trading-sdk — the audited Rust core used by all SDK bindings.

Quick Example

import {
  ExchangeClient,
  Side,
  generateKeypair,
  pubkeyToOwner,
  ownerToHex,
} from "@proof/trading-sdk";

const { publicKey, privateKey } = generateKeypair();
const address = pubkeyToOwner(publicKey);

const client = new ExchangeClient({ chainId: "exchange-devnet-1" });
client.setPrivateKey(privateKey);

const result = await client.submitTx({
  type: "PlaceOrder",
  data: {
    market: 1,
    owner: address,
    side: Side.Buy,
    price: 50000000n, // $500,000.00 in cents
    quantity: 1n,
  },
});

console.log(result); // { code: 0, hash: "…" }
The SDK connects to the Proof devnet by default (https://api.dev.proof.trade). Pin chainId: "exchange-devnet-1" for deterministic cross-build signatures.

Build docs developers (and LLMs) love