FastMM
FastMM is a low-latency market-making engine. Read the documentation.
https://github.com/user-attachments/assets/dcd130c5-28fe-482f-a757-d0fc6550c5b9
Features
- Strategies in C++ or Python. Python hooks marked
@fastmm.hotcompile to machine code with Numba. - One strategy file for backtest and live. Replays are deterministic, and the simulated exchange models queue position.
- Account pools. Several sub-accounts trade behind one venue, and orders spread across them.
- Gateway. One
fastmm-gatewayholds the exchange connections; several strategy processes attach to it and can stop or restart without dropping them. - Live control.
fastmm-ctlchanges a running session's parameters without a restart. - A/B tests. Parameter sets run side by side, split by instrument, by time block or both, and are compared on markouts and net with paired intervals.
- Low-latency tuning. Core pinning, busy polling, and AF_XDP or DPDK receive for UDP multicast feeds. Order entry runs on the kernel TCP stack, which OpenOnload or XLIO can replace through
LD_PRELOAD.
Quickstart
The package on PyPI is fastmm-engine, imported as fastmm; pip install fastmm installs a different project.
python3 -m venv .venv && . .venv/bin/activate
pip install "fastmm-engine[hot]"
fastmm init my-mm && cd my-mm
python backtest.py
This runs a strategy on a simulated market, with no account and no API keys (Linux x86-64, Python 3.10+). On Debian and Ubuntu, sudo apt install python3-venv first; on macOS or Windows, run it in Docker. The quick start continues to a live session against the local simulated exchange; C++ strategies start from the C++ quick start.
A strategy
import fastmm
from fastmm import Param
class TouchMM(fastmm.Strategy):
half_spread_bps = Param(0.01, min=0.0, doc="half spread, bps")
quote_qty = Param(0.002, min=0.0, doc="size per side")
@fastmm.hot # compiled to machine code with Numba
def on_book(self, ctx, book):
if not book.valid:
ctx.pull()
return
half = book.mid * self.half_spread_bps * 1e-4
ctx.clear()
ctx.bid(book.mid - half, self.quote_qty)
ctx.ask(book.mid + half, self.quote_qty)
ctx.keep_passive()
Exchanges
Binance (spot and USDⓈ-M futures), OKX, Bybit, Gate, Hyperliquid, Lighter, Deribit, Gemini and Coinbase. A Nasdaq connector (TotalView-ITCH market data, OUCH 5.0 orders) trades only against the bundled simulator, fastmm-sim-itch.
If you are running FastMM on Binance, try bndesk, a real-time dashboard for your accounts.
License
Metadata
Release files for fastmm-engine 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastmm_engine-0.9.0.tar.gz | 6.7 MB | Without provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| fastmm_engine-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.28+ x86-64 | Details |
| fastmm_engine-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details |
| fastmm_engine-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| fastmm_engine-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details |
| fastmm_engine-0.9.0-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 26.6 MB
Release files / fastmm_engine-0.9.0.tar.gz
| Download URL | fastmm_engine-0.9.0.tar.gz |
|---|---|
| Size | 6.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
063e90627b136253e24a08680407cb5bc4084318b2e3cfac273d12cedba1c445
|
|
BLAKE2b-256 checksum How to use checksums |
c014bb0e4cfd36274343e74b831bcb859e5e92c16e6389474e03272e8daf87b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / fastmm_engine-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | fastmm_engine-0.9.0-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dc4e000088e0a6d79c1032cc8bffb90a521bb02c7c873e75f98cc4ed5e4b36f1
|
|
BLAKE2b-256 checksum How to use checksums |
8260c2c51a28ff5a8b75fd54380bb6aa634cd83e786ff416340b59386f79d45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / fastmm_engine-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | fastmm_engine-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1d3000f541c82c3535c8cb09010eca1914e9d648912d785def1016f51d8e8c14
|
|
BLAKE2b-256 checksum How to use checksums |
0039007248190a69fddf6e29a8b4c81b05c8f5f83050ff43595b8b17e4c97c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / fastmm_engine-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | fastmm_engine-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9fb6f7be65e63bd2e38e9a561a4372eb597b8c5f268c2c9bffafa7b1f04b4343
|
|
BLAKE2b-256 checksum How to use checksums |
8c7b08065ffd5b7d26ad747f8f2e4cddf0c97f0fb4038513f065c6f0a3bc678f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / fastmm_engine-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | fastmm_engine-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9078f7b77b44fcda32407800b217927f60430b25ce34f176d86f88422de8e51f
|
|
BLAKE2b-256 checksum How to use checksums |
69885e6ef9360a7e15fd438adf948142d3db0e15ee5a2bcc64b363f8360d0a94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / fastmm_engine-0.9.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | fastmm_engine-0.9.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d6448a1477f3018ad42cb124932f28fa3cc005e10337edd24628adff70606112
|
|
BLAKE2b-256 checksum How to use checksums |
c7fe69af51334cb5f95fbce31fff5fc9f7127a26d650f177798c6f42bf3f5b87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for fastmm-engine 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.