Skip to main content

FastMM

CI Docs PyPI License

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.hot compile 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-gateway holds the exchange connections; several strategy processes attach to it and can stop or restart without dropping them.
  • Live control. fastmm-ctl changes a running session's parameters without a restart.
  • Low-latency tuning. Host and network tuning built in, such as core pinning and kernel bypass.

Quickstart

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.

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, OKX, Bybit, Gate, Hyperliquid, Lighter, Deribit, Gemini and Coinbase. Nasdaq over TotalView-ITCH and OUCH 5.0.

If you are running FastMM on Binance, try bndesk, a real-time dashboard for your accounts.

License

MIT

Metadata

Release files for fastmm-engine 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastmm-engine 0.6.0
File Size Uploaded
fastmm_engine-0.6.0.tar.gz 4.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for fastmm-engine 0.6.0
File
fastmm_engine-0.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
fastmm_engine-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
fastmm_engine-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
fastmm_engine-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
fastmm_engine-0.6.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 18.8 MB

Release files / fastmm_engine-0.6.0.tar.gz

Download URL fastmm_engine-0.6.0.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b48053330f921c71600b47bd3fbd0d2e4bdd5c0fb03a57e4ca083949683eb345
BLAKE2b-256 checksum
How to use checksums
71a565a998d196d2dbb0a545adb56730f340454ff22e70a6c86858db6408701e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4677a9d73bac0cd22903e808a96ffca9b311fc29c656136a194968b4f6f680f1
BLAKE2b-256 checksum
How to use checksums
3461bd441352d61aa63e25f10402ff162fe5bc50ec1f1726a956fc843c4ef277
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bb081e68ce4b1f8f7347b867fb51bcce40e4f92f5895608e8bcc77639f3c380f
BLAKE2b-256 checksum
How to use checksums
5d7500ce6cdb17681d743e66b0e4ed6a36adcada5b61610d96003c1188569dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8d96e0442d59a1b9beedd5e19c51f9d4e76e438fe60f6644c916b801a819d8d3
BLAKE2b-256 checksum
How to use checksums
eeb61ca717983bf682a5c3782c1b0f234e121be5523ca92ba325bd0fcd6d0442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
38490ed428471e8e501322a4d9b4560e4f318c20c51ba55040334970c393ced8
BLAKE2b-256 checksum
How to use checksums
6bd8e6cfb41f62dc266434f2986055e38206d67002e63397f68f75b35ac12fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.6.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.6.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6b8f0f70374a14b8017b0c7f85bcf6dedcad1f91bb093320820347f171f31e7a
BLAKE2b-256 checksum
How to use checksums
d3c8be3b4f6f8f36301ae45ccd5148aa38d83d5ad0ce8469fe67c97e821142c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.6.0 This release

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.0

7 release files

0.3.0

7 release files

0.2.0

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page