# OpenPit > OpenPit is an open-source, embeddable pre-trade risk engine and SDK for algorithmic and electronic trading systems. It has a Rust core with Go, Python, JavaScript/TypeScript, C++, and C interfaces. It ships built-in risk policies and a policy SDK for building custom checks. > Checks run inside the trading application, before the host application sends the order. Built-in checks include order size limits, order rate limits and a P&L bounds kill switch. Evaluate orders before submission, finalize reservations explicitly, and feed execution reports back into the engine. The host application owns venue connectivity, persistent storage, market data, and coordination around a shared engine. Available scopes depend on the policy. OpenPit is pre-1.0: minor releases may change public APIs. Use documentation and examples matching the installed release. ## Start an integration Start with the [integration route and AI coding prompt](https://wiki.openpit.dev/Getting-Started/#integration-route). Choose the language, target platform, and SDK version before writing code. Run the selected binding's self-contained quick start, then implement the lifecycle and application-owned responsibilities it links to. The wiki and unversioned generated API site describe development sources. Links to GitHub `main` also track development. For an installed release, select its tag in the [SDK source and release history](https://github.com/openpitkit/pit/releases), and use the README, examples, and API of that version. Go and Rust API hosts also provide version selectors. Verify exact API names in the selected binding; do not translate names from another language or invent missing methods. Demonstrate an accepted order and a documented policy rejection before connecting a real venue. Test submission failure, explicit reservation finalization, execution reports, and the threading contract for the chosen policies. Venue submission and persistence belong to the application; documentation placeholders such as `send_order_to_venue` are not OpenPit APIs. ## Complete documentation indexes - [Wiki index for AI tools](https://wiki.openpit.dev/llms.txt): Integration concepts, policy contracts, and operational guidance. - [Generated API index for AI tools](https://docs.openpit.dev/llms.txt): Direct links to generated reference pages, including pages that a JavaScript navigation menu may not expose to a text reader. - [SDK releases](https://github.com/openpitkit/pit/releases): Release tags, notes, and native runtime assets. **What it is** - Pre-trade risk SDK and engine, embedded in-process (no separate service required). - Deterministic: matching policies, state, market data, event timing, and order inputs produce the same decision. - In-memory: the engine does not persist state or route orders to venues. Custom policy callbacks are supplied by the integrator. - Policy-driven: limits, exposures, and rules are configured declaratively. - Synchronization is chosen when building the engine; callers must follow the threading contract. - License: Apache-2.0. **Policies** - Built-in pre-trade policies: spot funds solvency control, order validation, rate limiting, order size limits, and a P&L bounds kill switch. - Custom policy SDK: build your own pre-trade checks as first-class policies in Go, Python, JavaScript/TypeScript, C++, Rust, or C. ## Documentation - [Order size, order rate and P&L bounds](https://openpit.dev/#policies-title): built-in brakes in the in-process engine; the host application sends orders. - [Getting started](https://wiki.openpit.dev/Getting-Started/): Installation and a first end-to-end flow. - [Runnable examples](https://github.com/openpitkit/pit/tree/main/examples/): Complete examples by language. - [Pre-trade pipeline](https://wiki.openpit.dev/Pre-trade-Pipeline/): Order checks, reservations, finalization, and execution reports. - [Runtime delivery](https://wiki.openpit.dev/Runtime-Delivery/): Native runtime setup and overrides for each SDK. - [Threading contract](https://wiki.openpit.dev/Threading-Contract/): Caller obligations and supported synchronization modes. - [Domain types](https://wiki.openpit.dev/Domain-Types/): Exact financial values and identifiers; use the binding's domain types for prices, quantities, amounts, and P&L. - [Errors](https://wiki.openpit.dev/Errors/): Boundary errors, policy rejects, and binding-specific error handling. - [Pre-trade lock](https://wiki.openpit.dev/Pre-Trade-Lock/): Policy-dependent reservation data, execution matching, and restart reconstruction. - [Market data](https://wiki.openpit.dev/Market-Data/): Price scopes, account-specific feeds, quote freshness, and FX inputs. - [Account groups](https://wiki.openpit.dev/Account-Groups/): Group membership and policy configuration for account groups. - [Policies](https://wiki.openpit.dev/Policies/): Built-in policy catalog, stage behavior, and synchronization. - [Spot Funds](https://wiki.openpit.dev/Spot-Funds/): Per-account solvency checks, reservations, and the holdings lifecycle. - [Policy API](https://wiki.openpit.dev/Policy-API/): Custom policy callbacks and the language-specific interfaces that implement them. - [Dynamic policy reconfiguration](https://wiki.openpit.dev/Dynamic-Policy-Reconfiguration/): Change live settings without rebuilding an engine. - [Account adjustments](https://wiki.openpit.dev/Account-Adjustments/): Apply non-trade state changes through the public contract. - [Balance reconciliation](https://wiki.openpit.dev/Balance-Reconciliation/): Reconcile caller-supplied state with the venue. ## Project - [Website](https://openpit.dev/): Landing page with installation and documentation links. - [Risk Playground](https://openpit.dev/playground/): Browser-only WebAssembly playground - set pre-trade limits, send simulated orders, and see the engine accept or reject each one. - [Source repository](https://github.com/openpitkit/pit): Rust workspace with Go, Python, JavaScript/TypeScript, C++, Rust, and C SDK surfaces. - [Wiki](https://wiki.openpit.dev/): Architecture, domain types, pipeline design, policies, and conceptual documentation. - [Discussions](https://github.com/openpitkit/pit/discussions): Questions, integration ideas, and community conversation. ## Packages - [Go installation and example](https://github.com/openpitkit/pit/blob/main/bindings/go/README.md): Uses cgo and a C compiler; includes native runtime setup. - [Python installation and example](https://github.com/openpitkit/pit/blob/main/bindings/python/README.md): Package installation and first order check. - [JavaScript/TypeScript installation and example](https://github.com/openpitkit/pit/blob/main/bindings/js/README.md): WASM initialization and runtime-specific entry points. - [C++ installation and example](https://github.com/openpitkit/pit/blob/main/bindings/cpp/README.md): CMake package and native runtime requirements. - [Rust installation and example](https://github.com/openpitkit/pit/blob/main/crates/openpit/README.md): Engine construction and a first order check. - [C installation and example](https://github.com/openpitkit/pit/blob/main/bindings/c/README.md): Headers, native runtime, and linking. - [Go module: go.openpit.dev/openpit](https://github.com/openpitkit/pit-go): `go get go.openpit.dev/openpit`. - [Go API](https://pkg.go.dev/go.openpit.dev/openpit): Package and subpackage reference with version selection. - [PyPI: openpit](https://pypi.org/project/openpit/): Python bindings (Linux, macOS, Windows wheels). `pip install openpit`. - [Python API](https://docs.openpit.dev/python-api/): Generated Python class, method, policy, and domain-type reference, plus Python-specific installation and integration guides. - [npm: @openpit/engine](https://www.npmjs.com/package/@openpit/engine): JavaScript/TypeScript bindings (WASM, ESM + CJS, Node + browser). `npm install @openpit/engine`. - [JavaScript/TypeScript API](https://docs.openpit.dev/js-api/): Generated package and subpath reference for `@openpit/engine`. - [C++ API](https://docs.openpit.dev/cpp-api/): C++ SDK reference for the `OpenPit::openpit` CMake package. - [crates.io: openpit](https://crates.io/crates/openpit): Rust crate. `cargo add openpit`. - [Rust API](https://docs.rs/openpit/latest/openpit/): Crate reference with version selection; choose the installed version rather than assuming `latest` matches it. - [C API](https://docs.openpit.dev/c-api/): C header reference and split per-section docs. ## See OpenPit in a real product - [Pit Officer](https://officer.openpit.dev/): One example of OpenPit in a real product: a separate control plane using the SDK as its pre-trade risk engine, with an operator dashboard, REST API, and MCP server. - [Pit Officer video guides](https://officer.openpit.dev/video-guides): Watch practical uses of the SDK for order checks, risk limits, balances, and accounts. Videos play on the page; the catalog selects a video in the page's language when available, otherwise the English version. ## License - [Apache License 2.0](https://github.com/openpitkit/pit/blob/main/LICENSE): The licence the engine and every SDK surface ship under.